project problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aartinair
    New Member
    • Jan 2010
    • 4

    project problem

    this is my code,this is showing a syntax error in insert into statement,plzz do help

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim myOleDbConnection As OleDb.OleDbConnection
    
            Dim insertcommand As String
    
            Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Radhakrishnan\My Documents\Visual Studio 2008\Projects\BHARATH MATRIMONY\BHARATH MATRIMONY\My Project\REGISTRATIONGROOM.accdb;Persist Security Info=False"
            insertcommand = "INSERT INTO GROOM(MATCH,NAME1,HEIGHT,AGE,COUNTRY,STATE,CITY,QUALIFICATION,CASTE,RELIGION,MOTHERTONGUE,MOBILENO,RESIDENCENO,EMAILID) VALUES ('" & cmbMatch.Text & "' ,'" & txtName.Text & "', '" & txtHeight.Text & "' ,'" & txtAge.Text & "' ,'" & cmbCountry.Text & "','" & cmbState.Text & "','" & cmbCity.Text & "' ,'" & txtQualification.Text & "','" & cmbCaste.Text & "','" & cmbReligion.Text & "','" & cmbMotherTongue.Text & "','" & txtMobile.Text & "','" & txtResidence.Text & "','" & txtEmailId.Text & "' )"
    
            myOleDbConnection = New OleDb.OleDbConnection(connString)
    
            Dim myOleDbCommand As New OleDb.OleDbCommand(insertcommand, myOleDbConnection)
    
            myOleDbConnection.Open()
    
            myOleDbCommand.ExecuteNonQuery()
            MsgBox("records saved")
            myOleDbConnection.Close()
        End Sub
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Please don't double post your questions.
    You've had several responses to the first time you posted this.

    Comment

    Working...