VB.net 2008 database manipulation help

July 6, 2009 at 08:51:03
Specs: Windows XP
plz help me figure out whts wrong with this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDb.OleDbConnection
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\Administrator\My Documents\db1.mdb"
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim Sql As String = "SELECT * FROM SaleTable"
da = New OleDb.OleDbDataAdapter(Sql, con)
Dim cb As New OleDb.OleDbCommandBuilder(da)

Dim dsNewRow As DataRow = ds.Tables("SaleTable").NewRow()
dsNewRow.Item("Date") = Label2.Text

If CheckBox1.Checked Then
dsNewRow.Item("ClientId") = TextBox1.Text

End If

If CheckBox2.Checked Then
dsNewRow.Item("InvoiceType") = "SSinvoice"
End If
If CheckBox4.Checked Then
dsNewRow.Item("PaymentMethod") = "Check"
End If
If CheckBox5.Checked Then
dsNewRow.Item("PaymentMethod") = "CreditCard"
End If
If CheckBox6.Checked Then
dsNewRow.Item("PaymentMethod") = "Debt"
End If


da.Update(ds, "SaleTable")

End Sub

See More: VB.net 2008 database manipulation help

Report •

October 22, 2009 at 02:29:53
what's the error message?

Report •
Related Solutions

Ask Question