SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=PROMOD-PC;Initial Catalog=UserDB;Integrated Security=True";
try
{
string Username = UserNTB.Text;
string password = UserPass.Text;
string Address = UserAdd.Text;
String QueryStr = "Insert into UserInfo(Username, Password, Address) Values (@UN, @UP, @UA)";
con.Open();
SqlCommand com = new SqlCommand(QueryStr, con);
com.Parameters.Add(new SqlParameter("@UN", UserNTB.Text));
com.Parameters.Add(new SqlParameter("@UP", UserPass.Text));
com.Parameters.Add(new SqlParameter("@UA", UserAdd.Text));
com.ExecuteNonQuery();
}
finally
{
con.Close();
}
-KR