| | |
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 |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dropdownlist excel fade file-dialog folder ftp generatetags hardcopy image images input insert intel internet login math mobile monitor ms navigate net networking objects opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project reports" savedialog searchvb.net select serial shutdown soap string survey tcp temperature text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





