Sending contents of multiple text box/combo box to Access database

chrismid259

Member
Joined
Feb 9, 2011
Messages
6
Programming Experience
Beginner
Hi,
Currently I'm working on a project based upon ticket sales. I'm at a stage where I need to send data collected during the ticket booking process to the Access database that I have set up. I'm attempting to send information such as forename, surname, address etc to the database that I have set up. I've had a go at coding it but constantly get an "OleDbException was unhandled" error.

This is the code I've implemented so far. I've highlighted the code that shows as an error in red.

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

Dim info As DataRow
info = Me.DatabaseDataSet1.customers.NewRow()

info.Item("forename") = Me.txtForename.Text
info.Item("surname") = Me.txtSurname.Text

Me.DatabaseDataSet1.customers.Rows.Add(info)
Me.CustomersTableAdapter.Update(Me.DatabaseDataSet1)

End Sub
Can anyone see what I'm doing wrong here?
 
Back
Top