employee name textbox
employee designation textbox
employee mobile number textbox
submit
when am submittg these values saved in to sql server 2008 i need c# code and how to web config
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Mar 3, 2014, 5:10 AM
On C# page
Some namespace
using System; using System.Collections.Generic; using System.Data.SqlClient;
protected void Page_load(object source, EventArgs e)
{
}
string str = configurationmanager.connectionstring["connect"].connectionstring();
protected void Submit_event(object source, EventArgs e)
{
sqlconnection con = new sqlconnection();
con.open();
sqlcommand cmd = new sqlcommand( "insert into tablename values("@1" , "@2", "@3",con)
cmd.Parameters.Addwithvalue( "@1",textbox1.text)
cmd.Parameters.Addwithvalue( "@2",textbox2.text)
cmd.Parameters.Addwithvalue( "@3",textbox3.text)
cmd.executenonquery();
con.close();}
Jignesh TrivediPosted Mar 3, 2014, 2:54 AM
hi,
Please refer below link it might help you.
http://www.dotnetperls.com/sqlclient
http://msdn.microsoft.com/en-us/library/ms233812.aspx
http://www.devmanuals.com/tutorials/ms/aspdotnet/insertdataindatabse.html