Joe Wilson

Joe Wilson

  • NA
  • 7.8k
  • 437.4k

What is the problem of My code about editting In c#?

Jul 5 2014 10:10 AM
The Error:
 
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll

Additional information: Syntax error in UPDATE statement.
 
 
 
My code:
 
public void Edit()
{
Connection C2 = new Connection();
C2.SetData("update Student set Student_Number = " + this.Student_Number + ", Name = '" + this.Name + "', Last Name = " + this.LastName + "',Field = " + this.Field + "',Average=" + this.Average + " where Student_Number = " + this.Student_Number + "',Student_ID=" + this.Student_ID + "");
}
 
 
 
 
 Please Help me solve my problem.
 
 
 
 
 

Answers (13)