INSERT ERROR

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to INSERT record in MYSQL database, but each time the code tries
to execute the command: MySQL_cmdGLAccount.ExecuteNonQuery(), it reports an
error with the message
"COLUMN COUNT DOESN'T MATCH VALUE COUNT AT ROW 1"
Am using MYSQL CONNECTOR FOR NET VERY 1.0.3 as my provider. Am wondering
what is going on in my code. Below is part of the code.

MySQL_Cnn.Open()
myTrans = MySQL_Cnn.BeginTransaction
MySQL_cmdGLAccount.Transaction = myTrans

strSQLInsert = "INSERT INTO
GLAccount(AccountNo,AccountName,AccountType,Note,Suspend,RetainedEarnings,DateTime) " _
& " VALUES (intAcctNo,'" & txtAccountName.Text & "','" &
strAccountType & "','" & txtNote.Text & "' " _
& " '" & strSuspend & "','" & strRetainedEarnings &
"',NOWDATE)"


MySQL_cmdGLAccount.CommandText = strSQLInsert
MySQL_cmdGLAccount.Connection = MySQL_Cnn
MySQL_cmdGLAccount.ExecuteNonQuery()
myTrans.Commit()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

MySQL Insert Error 1

Back
Top