hi, now I wants to insert some records into table in Microsoft Access and C#, below is my codes :
SQLStr = "Insert Into RegisterEmployee(EmployeeName,Password,Gender,ContactNumber,Position) " +
"Values ('" +
SQLStrCmd.ReplaceStr(nameReg.Text) + "', '" +
SQLStrCmd.ReplaceStr(passReg.Text) + "', '" +
SQLStrCmd.ReplaceStr(genReg.Text) + "', '" +
SQLStrCmd.ReplaceStr(Hptxt.Text) + "', '" +
SQLStrCmd.ReplaceStr(posReg.Text) + "')";
if (AccessDb_Cmd.ExecuteNonQuery(SQLStr, Access_Db))
{
// Do event
}
My table has attributes of ID (auto number),EmployeeName(text),Password(text),Gender(text),ContactNumber(Number) and Position(text).
When I compile the program, it detected that my sql query has exception, but i cant found out the error in my sql query as above, anyone please help me.