views:

92

answers:

0

I am trying to Insert a record in MS Access DB using OLEDB in windows application.

I am getting an error "missing semicolon at end of sql statement" there is no syntax error in sql insert statment.

My code

            Insert statement =  INSERT INTO Student
            VALUES ('SRI-10-101','001','guru','30/05/2010 12:00:00 AM','','','','','','','600028','','','','','','','30/05/2010 11:25:44 AM','');

            conn = this.GetConnection();// which returns Connection object
            tran = conn.BeginTransaction();
            OleDbCommand cmd = conn.CreateCommand();
            cmd.Connection = conn; 
            cmd.CommandText = strQuery;// Insert statement
            cmd.CommandType = CommandType.Text;
            cmd.Transaction = tran;
            cmd.ExecuteNonQuery();
            tran.Commit();

I tried with semicolon also still i get error;

Thanks