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

Which is better ole db or odbc?

857


What is the difference between linq and ado.net?

943


What are the 3 major types of connection objects in ado.net?

940


Define ado.net?

1037


What is the hierarchy of data in databases?

896


How can we check that some changes have been made to dataset since it was loaded?

920


What is the meaning of object pooling?

1129


What is defaultview in datatable?

989


How can we save all data from dataset?

942


Can you explain how to enable and disable connection pooling?

924


What are the Features of a dataset

1184


What is the executescalar method?

1023


How to store data in memory?

893


What is connection in ado.net?

891


Is entity framework better than ado.net?

934