Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What we do with the object of ado.net dataset after using it?

981


Explain what is datagrid with an example?

1055


Which provider is used to connect ms access, oracle, etc…?

970


What are the disadvantages of using datalist?

996


What are the difference between readonly vs. Const?

963


What is sqldatareader in ado.net?

886


Can we load multiple tables in a dataset?

1085


What do you mean by ‘batch updates’?

1006


What is the difference between typed and untyped dataset?

1026


What is the role of data provider in ado.net?

968


How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

992


What is the difference between statement and preparedstatement interface?

971


What are the key features of ado.net?

1160


Explian About DataAdapters

996


What is difference between entity framework and ado.net?

897