Hello am having problems updating my database from vb.net from am getting an error that I have not provided all the values as required though in my database no values are set as required. here is the snippet
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
connString = provider & dataFile
myConnection.ConnectionString = connString
myConnection.Open()
2013\Projects\projectempdb.mdb"
Dim str As String
str = "update [EmployeeInfo] set [Designition] = '" + TextBox3.Text + "' , [TermsOfService] = '" + TextBox7.Text + "', [OtherQualification] = '" + TextBox4.Text + "', [Dolp] = '" + DateTimePicker1.Text + "', [Dor] = '" + DateTimePicker2.Text + "' Where [IdNo] = '" + TextBox2.Text + "'"
Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection)
Try
cmd.ExecuteNonQuery()
cmd.Dispose()
'' myConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
here are my variables
Dim provider As String = "Provider=Microsoft.jet.oledb.4.0;Data Source = "
Dim dataFile As String = "C:\Users\JackOyee\Documents\Visual Studio 2013\Projects\projectempdb.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
Dim connString As String
my import
Imports System.Data.OleDb