i want 2 pass values(enterd in textbox)to table in sql
server without using stored procedure in c#.plz tell me
code with an example.

Answer Posted / michael and tubax

sqlconnection con=new sqlconnection
("server=servername;datasource=databasename;uid=sa;pwd=passw
ord);
con.open();
sqlcommand cmd=new sqlcommand("insert into tblname values
('"+txtname.text+"','"+txtage.text+"'",con);
cmd.executnonquery();
con.close();

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we serialize the dataset object?

538


Explain the difference in record set and dataset?

470


What are the namespaces used in ado.net for data access?

465


What is the difference between Optimistic and Pessimistic locking?

525


Does sqlclient and oledb class share the same functionality?

515






What does executequery return?

502


What is the difference between executenonquery () and executescalar ()?

461


What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

541


What are the major difference between classic ADO and ADO.NET?

496


Can we load multiple tables in a dataset?

520


Explain what are acid properties?

522


What are dataproviders?

519


What you mean by filtering of data?

520


Explain the difference between data reader and data adapter?

488


What is namespace in ado.net?

484