| | |
syntax error in INSERT INTO statement
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 132
Reputation:
Solved Threads: 13
here is my code
Dim oledbcom As New OleDb.OleDbCommand
oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")
oledbcom.Connection = oledbcon
Dim oledbparam As OleDb.OleDbParameter = _
oledbcom.Parameters.Add("@Company", OleDb.OleDbType.VarChar, 30)
oledbparam.Value = txtCompName.Text.Trim()
oledbparam = oledbcom.Parameters.Add("@Address", OleDb.OleDbType.VarChar, 80)
oledbparam.Value = txtAddress.Text.Trim
oledbparam = oledbcom.Parameters.Add("@Telephone", OleDb.OleDbType.VarChar, 15)
oledbparam.Value = txtContact.Text.Trim
oledbcom.ExecuteNonQuery()
Dim oledbcom As New OleDb.OleDbCommand
oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")
oledbcom.Connection = oledbcon
Dim oledbparam As OleDb.OleDbParameter = _
oledbcom.Parameters.Add("@Company", OleDb.OleDbType.VarChar, 30)
oledbparam.Value = txtCompName.Text.Trim()
oledbparam = oledbcom.Parameters.Add("@Address", OleDb.OleDbType.VarChar, 80)
oledbparam.Value = txtAddress.Text.Trim
oledbparam = oledbcom.Parameters.Add("@Telephone", OleDb.OleDbType.VarChar, 15)
oledbparam.Value = txtContact.Text.Trim
oledbcom.ExecuteNonQuery()
Didn't test it but if I remember right
should be
HTH
VB.NET Syntax (Toggle Plain Text)
oledbcom.CommandText = ("INSERT INTO Customer Company, Address, Telephone values ?,?,?")
VB.NET Syntax (Toggle Plain Text)
oledbcom.CommandText = ("INSERT INTO Customer (Company, Address, Telephone) values (?,?,?)")
HTH
Teme64 @ Windows Developer Blog
Hi! Nice to hear that you got answer to your problem. Could you please mark the thread as solved. Thank you!
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Syntax error in UPDATE statement. (VB.NET)
- Save Data in Database , Syntax error (ASP.NET)
- Need Urgent HELP-Syntax error, insert "AssignmentOperator Expression" to complete Ass (JSP)
- Syntax error in INSERT INTO statement, please help (ASP)
- Syntax error in INSERT INTO statement (Java)
- syntax error: i cant find it..HELP! (ASP)
Other Threads in the VB.NET Forum
- Previous Thread: help me out
- Next Thread: ListView Small Probs
| Thread Tools | Search this Thread |
.net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons c# center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images inline insert intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial server soap sql table tcp text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





