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()
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()