Imports System.Data.OleDb
Public Class Form10
Private Sub Form10_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.付费明细TableAdapter.Fill(Me.EndDataSet.付费明细)
Me.DataGridView1.DataSource() = objdt2.Tables("付费明细")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form4.Show()
Me.Close()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Form11.TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value
Form11.TextBox2.Text = DataGridView1.CurrentRow.Cells(1).Value
Form11.TextBox3.Text = DataGridView1.CurrentRow.Cells(2).Value
Form11.TextBox4.Text = DataGridView1.CurrentRow.Cells(3).Value
Form11.DateTimePicker1.Value = DataGridView1.CurrentRow.Cells(4).Value
Form11.DateTimePicker2.Value = DataGridView1.CurrentRow.Cells(5).Value
Form11.TextBox5.Text = DataGridView1.CurrentRow.Cells(6).Value
Form11.TextBox6.Text = DataGridView1.CurrentRow.Cells(7).Value
Form11.Show()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
constr = "provider=Microsoft.ACE.OLEDB.12.0;data source=end.accdb"
objconn.ConnectionString = constr
sqlstr = "select * from 付费明细"
objadp = New OleDbDataAdapter(sqlstr, objconn)
objadp.Fill(objdt, "付费明细")
sqlstr = "Delete * from 付费明细 where 项目编号=" & DataGridView1.CurrentRow.Cells(0).Value & ""
objcmd = New OleDbCommand(sqlstr, objconn)
objconn.Open()
objcmd.ExecuteNonQuery()
MsgBox("删除成功")
objconn.Close()
objadp.Fill(objdt, "付费明细")
Me.DataGridView1.DataSource() = objdt1.Tables("付费明细")
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Me.Close()
End Sub
End Class
Public Class Form10
Private Sub Form10_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.付费明细TableAdapter.Fill(Me.EndDataSet.付费明细)
Me.DataGridView1.DataSource() = objdt2.Tables("付费明细")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form4.Show()
Me.Close()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Form11.TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value
Form11.TextBox2.Text = DataGridView1.CurrentRow.Cells(1).Value
Form11.TextBox3.Text = DataGridView1.CurrentRow.Cells(2).Value
Form11.TextBox4.Text = DataGridView1.CurrentRow.Cells(3).Value
Form11.DateTimePicker1.Value = DataGridView1.CurrentRow.Cells(4).Value
Form11.DateTimePicker2.Value = DataGridView1.CurrentRow.Cells(5).Value
Form11.TextBox5.Text = DataGridView1.CurrentRow.Cells(6).Value
Form11.TextBox6.Text = DataGridView1.CurrentRow.Cells(7).Value
Form11.Show()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
constr = "provider=Microsoft.ACE.OLEDB.12.0;data source=end.accdb"
objconn.ConnectionString = constr
sqlstr = "select * from 付费明细"
objadp = New OleDbDataAdapter(sqlstr, objconn)
objadp.Fill(objdt, "付费明细")
sqlstr = "Delete * from 付费明细 where 项目编号=" & DataGridView1.CurrentRow.Cells(0).Value & ""
objcmd = New OleDbCommand(sqlstr, objconn)
objconn.Open()
objcmd.ExecuteNonQuery()
MsgBox("删除成功")
objconn.Close()
objadp.Fill(objdt, "付费明细")
Me.DataGridView1.DataSource() = objdt1.Tables("付费明细")
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Me.Close()
End Sub
End Class