try {
coect.Close();
coect.Open();
SqlCommand CMD = new SqlCommand("insert into login1 Values(@username,@pass)", coect);
CMD.Parameters.AddWithValue("@username", textBox6.Text);
CMD.Parameters.AddWithValue("@pass", textBox4.Text);
CMD.ExecuteNonQuery();
coect.Close();
MessageBox.Show("باموفقیت ذخیره شد");
}catch
{
MessageBox.Show("نام کاربری وارد شده تکراری می باشد");
}
برچسب:
نویسنده: خنج