I am trying to insert a record in the database, but it throws the exception.
Its very urgent, kindly help
My code is:-
If TextBox4.Text = "" Or TextBox5.Text = "" Then
MsgBox("Enter all Fields")
Else
Dim connStr As New OleDb.OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = Performance.MDB")
Dim sqlStr As New OleDb.OleDbCommand("insert into Period1 values (a,b,c,d,m,f,g,h,i,j,k,l)", connStr)
Try
connStr.Open()
sqlStr.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Data Access Error.")
Finally
connStr.Close()
End Try
Its very urgent, kindly help
My code is:-
If TextBox4.Text = "" Or TextBox5.Text = "" Then
MsgBox("Enter all Fields")
Else
Dim connStr As New OleDb.OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = Performance.MDB")
Dim sqlStr As New OleDb.OleDbCommand("insert into Period1 values (a,b,c,d,m,f,g,h,i,j,k,l)", connStr)
Try
connStr.Open()
sqlStr.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Data Access Error.")
Finally
connStr.Close()
End Try