problem in vb.net

Dec 17 2008 2:08 AM

Nowadays I am working on one of my assignments in vb.net. Assignment is about making a software that work like ATM.
I am facing problem in this query for the access database
error is syntax error but there is no error as far i know
I will appreciate if you can help
statement is

cmd = New OleDbCommand("INSERT INTO Transaction  VALUES('" & WithDrawTxt.Text & "','" & AccountNo.ToString & "','" & dt.ToString & "')", cn)
i = cmd.ExecuteNonQuery

Table Transaction has fields Amount, Account_Number, Transaction_Date and last is Transaction#. All have field text except Transaction# which is auto number.

I have changed it to following statement too but its not working even then

cmd = New OleDbCommand("INSERT INTO Transaction(Amount,Account_Number,Transaction_date) VALUES('" & WithDrawTxt.Text & "','" & AccountNo.ToString & "','" & dt.ToString & "')", cn)
i = cmd.ExecuteNonQuery


Answers (3)