Hi Every One i have sqlserver connections.
Drag and drop the sqlconnection from web forms.
and
include the name space called using system.data.sqlclient
then write code
string regstr="workstation id=HY;packet size=4096;user id=sa;pwd=sa;data source=DATASERVER;persist security info=False;initial catalog=Senthilkumar";
SqlConnection regcon = new SqlConnection(regstr);
regcon.Open();
string regqry="insert into UserReg values('"+txtUserId.Text+"','"+txtPassword.Text+"' ,'"+txtReEnterPassword.Text+"','"+txtfirstname.Tex t+"','"+txtMiddlename.Text+"','"+txtLasrName.Text+ "','"+txtAddress.Text+"','"+txtPinCode.Text+"','"+ txtCountary.Text+"','"+txtState.Text+"','"+txtPhon eHome.Text+"','"+txtPhoneMobile.Text+"','"+txtMobi leOffice.Text+"')";
SqlCommand regcmd = new SqlCommand(regqry,regcon);
regcmd.ExecuteReader();
regcon.Close();
|