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 is the use of ADO.NET and XML web services?

1088


Can datareader hold data from multiple tables?

1221


Define isolation?

1023


How to pass multiple tables in datasets simultaneously?

1114


How do you update database through dataset?

1025


Explain advantages of ado.net?

1097


Is ado.net an orm?

1006


What are the Data providers in ADO.Net?

1067


What is ole in vb?

950


Do you use stored procedure in ado.net?

1079


What is the difference between a datareader and a dataset?

1098


What is a data control clerk?

1095


Define ado.net?

1183


Is bulk insert faster than insert?

961


What is ado.net architecture?

969