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
What we do with the object of ado.net dataset after using it?
Explain what is datagrid with an example?
Which provider is used to connect ms access, oracle, etc…?
What are the disadvantages of using datalist?
What are the difference between readonly vs. Const?
What is sqldatareader in ado.net?
Can we load multiple tables in a dataset?
What do you mean by ‘batch updates’?
What is the difference between typed and untyped dataset?
What is the role of data provider in ado.net?
How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
What is the difference between statement and preparedstatement interface?
What are the key features of ado.net?
Explian About DataAdapters
What is difference between entity framework and ado.net?