{
String constr=@ "Data Source=(LocalDB) \ MSSQLLocalDB; AttachDbFilename=E: \ student \ student \ stu MDF. Integrated Security=True ";
SqlConnection con=new SqlConnection (constr);
Con. The Open ();
[/code] string SQLSTR="update Reward set RewardId='" + textBox1. Text. The ToString () +"', RewardName='" + textBox2. Text. The ToString () + "' from Reward where studentNo='" + textBox3. Text. The ToString () + "' ";
SqlCommand CMD=new SqlCommand (); [/color]
CMD. Connection=con;
Cmd.Com mandText=SQLSTR;
Int r=CMD. ExecuteNonQuery ();
Con. The Close ();
If (r==0)
{
MessageBox. Show (" change failure!" );
}
The else
{
MessageBox. Show (" change success!" );
}
}
CodePudding user response:
Remove the from RewardCodePudding user response: