Note that there are some explanatory texts on larger screens.

plurals
  1. POSyntax error in INSERT INTO Statement in vb.net
    primarykey
    data
    text
    <p>I am getting and syntax error in insert into statement. <code>IF</code> statement is working just fine just getting this error when it's trying to save the information</p> <pre><code>Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If txt12Per.Text &gt;= TextBox12.Text And txtGPer.Text &gt;= TextBox11.Text And TextBox1.Text &gt;= TextBox10.Text Then Try 'Dim da As OleDb.OleDbDataAdapter Dim dbprovider As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Taher\Documents\Visual Studio 2010\Projects\WindowsApplication1\WindowsApplication1\Database1.accdb;Persist Security Info=False;" Me.con = New OleDb.OleDbConnection() con.ConnectionString = dbprovider con.Open() Dim sqlquery As String = "INSERT INTO MCAscheduled (URno,SName,hsc,gper,pgper,pstatus,cname,hrname,position,hscinter,ginter,pginter,comments)" + "VALUES (" &amp; CInt(txtUrn.Text) &amp; ",'" &amp; txtName.Text &amp; "'," &amp; CInt(txt12Per.Text) &amp; "," &amp; CInt(txtGPer.Text) &amp; "," &amp; CInt(TextBox1.Text) &amp; ",'" &amp; ComboBox2.Text &amp; "','" &amp; TextBox3.Text &amp; "','" &amp; TextBox4.Text &amp; "','" &amp; ComboBox4.Text &amp; "'," &amp; CInt(TextBox12.Text) &amp; "," &amp; CInt(TextBox11.Text) &amp; "," &amp; CInt(TextBox10.Text) &amp; ",'" &amp; TextBox9.Text &amp; "');" Dim sqlcommand As New OleDb.OleDbCommand(sqlquery) With sqlcommand .CommandText = sqlquery .Connection = con .ExecuteNonQuery() con.Close() txtUrn.Text = "" txt12Per.Text = "" txtGPer.Text = "" txtName.Text = "" cmbNameofGCourse.Text = "" End With MsgBox("Record Added") Catch ex As Exception MsgBox(ex.ToString) End Try Else MsgBox("Student Not eligible for the requested company") End If End Sub </code></pre> <p>Can somebody help me with this....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload