Hi, I am Trying to insert values in Access DataBase,But getting a syntax error.Following is my code. Dim ConnString As String Dim i As Integer Dim str1 As String = "C:\AccessData\Temp.mdb" Dim StrSql As String Dim _command As OleDbCommand ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & str1 & ";" Dim _connection As New OleDbConnection(ConnString) _connection.Open() For i = 0 To dtCSV.Rows.Count - 1 StrSql = "Insert into [JOBPART] (code,claimid,sectioncode,defactcode,repaircode)Values('" & dtCSV.Rows(i).Item(0) & "','" & dtCSV.Rows(i).Item(1) & "','" & dtCSV.Rows(i).Item(2) & "','" & dtCSV.Rows(i).Item(3) & "','" dtCSV.Rows(i).Item(4) & "')" _command = New OleDbCommand(StrSql, _connection) _command.Connection = _connection _command.ExecuteNonQuery() Next _connection.Close()
Any help would be appreciated.Thanks..