Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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"
con.Open()
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.TextIf CheckBox1.Checked Then
dsNewRow.Item("ClientId") = TextBox1.TextEnd 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 Ifds.Tables("SaleTable").Rows.Add(dsNewRow)
da.Update(ds, "SaleTable")
con.Close()
End Sub

![]() |
cross table delete
|
Setting up SQL on my home...
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |