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 method is used to sort the data in ADO.Net?

1978


What two types of data providers does ADO.NET supply? What determines which one you should use?

993


What is the default provider in ado.net?

965


Give an example that shows how to execute a stored procedure in ado.net?

1074


What is ado.net architecture?

929


What is two way data binding android?

988


Which is faster ado.net or linq?

1027


Does dapper use ado.net?

1017


What are the rules to implement connection pooling?

1069


What is ado asp?

1000


What is ole word?

951


What are different layers of ADO.Net?

1094


How do you update a dataset in ado.net?

1030


What is difference between sqldatareader and sqldataadapter?

931


Explain sqlconnection object?

1005