Hi guys.
I have an Access DB that has a Course table with a primery key CourseSignature which has a validation rule
Like "[A-Z][A-Z][A-Z][A-Z]###". For example CSCB343. When I try to enter a value in the DB with
OleDbCommand insertCommand = new OleDbCommand();
insertCommand.C ommandText = "INSERT INTO Course(CourseSi gnature, CourseName, Credits) VALUES('" + signature + "', '" + name + "', " + credits + ")";
insertCommand.C onnection = conn.getOleConn ();
insertCommand.E xecuteNonQuery( );
it gives me an exception that the CourseSignuter is not in the format Like "[A-Z][A-Z][A-Z][A-Z]###". Why!!?!
I have an Access DB that has a Course table with a primery key CourseSignature which has a validation rule
Like "[A-Z][A-Z][A-Z][A-Z]###". For example CSCB343. When I try to enter a value in the DB with
OleDbCommand insertCommand = new OleDbCommand();
insertCommand.C ommandText = "INSERT INTO Course(CourseSi gnature, CourseName, Credits) VALUES('" + signature + "', '" + name + "', " + credits + ")";
insertCommand.C onnection = conn.getOleConn ();
insertCommand.E xecuteNonQuery( );
it gives me an exception that the CourseSignuter is not in the format Like "[A-Z][A-Z][A-Z][A-Z]###". Why!!?!
Comment