รบกวนขอโค้ดเชื่อมต่อฐานข้อมูล Microsoft SQL sever Express
Public Class datacrow
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.CrowBindingSource.AddNew() End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
End Sub
Private Sub datacrow_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'FramnomDataSet.crow' table. You can move, or remove it, as needed. Me.CrowTableAdapter.Fill(Me.FramnomDataSet.crow)
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Me.Validate() Me.CrowBindingSource.EndEdit() Me.CrowTableAdapter.Update(Me.FramnomDataSet.crow) End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.CrowBindingSource.RemoveCurrent() End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Validate() Me.CrowBindingSource.EndEdit() Me.CrowTableAdapter.Update(Me.FramnomDataSet.crow) End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Me.Close() End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click =========== ตรงนี้ขอโค้ดปุ่มแก้ไขไปยังฐานข้อมูลด้วยคับ========== End Sub End Class
******** แต่ละคำสั่งผมลองทำแล้วมันโชว์แค่ในตัวโปรแกรม มันไม่ยอมอัพเดทไปที่ฐานข้อมูลอ่า ยังไงก็ช่วย ดูหน่อยนะคับ ******** ขอบคุนมากคับ
|