Hi, in the next couple of weeks I have to developpe a vb.net application witch uses MS Access a lot. I have been able to fill up comboboxes with data from database. But I just don't manage to place some silly names into the database with the insert command and executeNonQuery.. I know it must a little detail but I just don't find it...
Always shows "System.exception"......
Example:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= C:\myDatabase.mdb;"
Dim oConn As OleDbConnection = New OleDbConnection(connectionString)
Dim strSQL As String = "insert into client values wirloff"
Dim oCmd As OleDbCommand = New OleDbCommand(strSQL, oConn)
Try
oConn.Open()
oCmd.ExecuteNonQuery()
Catch ex As Exception
Throw New Exception("Failure", ex)
End Try
End Sub
Always shows "System.exception"......
Example:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= C:\myDatabase.mdb;"
Dim oConn As OleDbConnection = New OleDbConnection(connectionString)
Dim strSQL As String = "insert into client values wirloff"
Dim oCmd As OleDbCommand = New OleDbCommand(strSQL, oConn)
Try
oConn.Open()
oCmd.ExecuteNonQuery()
Catch ex As Exception
Throw New Exception("Failure", ex)
End Try
End Sub