How to store textbox value in database

Solved/Closed
NewUser - Mar 30, 2010 at 02:55 AM
 sham - Jan 26, 2015 at 08:34 PM


hello.. im a new user of asp.net.. im creating an asp.net webpage using VB code.

I wanted to know how to store the textbox value(input from user) into the sql databse table..
i need a sample codef or this.
im using ASP.NET 3.5, Visual Studio 2008, SQL server 2005.

Help is really appreciated.. thank you

7 responses

sqlconnection myconn=new sqlconnection();
myconn.connectionstring="-------specify path here------";
myconn.open();
string qry="insert into table1 values('"+username+"','"+password+"')";
sqlcommand cmd=new sqlcommand(qry,myconn);
cmd.ExecuteNonQuery();
myconn.Close();
49
exactly correct,thanks
0
correct 1
0