Koneksi Database SQL server 2005 dan VB.net
Cara Membuat Database SQL Server 2005 :
1. Nim
2..Nama
3. Alamat
4. TglLahir
5. Jurusan
6. SppTetap
Script Program pada VB.Net :
Hasil Program :
Koding :
1. Tombol <
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.TbmahasiswaBindingSource.MovePrevious()
End Sub
2. Tombol <<
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.TbmahasiswaBindingSource.MoveFirst()
End Sub
3. Tombol >
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.TbmahasiswaBindingSource.MoveNext()
End Sub
Me.TbmahasiswaBindingSource.MoveNext()
End Sub
4. Tombol >>
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.TbmahasiswaBindingSource.MoveLast()
End Sub
Me.TbmahasiswaBindingSource.MoveLast()
End Sub
5. Tombol Add
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.TbmahasiswaBindingSource.AddNew()
End Sub
Me.TbmahasiswaBindingSource.AddNew()
End Sub
6.Tombol Edit
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.Validate()
Me.TbmahasiswaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DbrinaDataSet)
End Sub
Me.Validate()
Me.TbmahasiswaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DbrinaDataSet)
End Sub
7. Tombol Remove
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Me.TbmahasiswaBindingSource.RemoveCurrent()
Me.TableAdapterManager.UpdateAll(Me.DbrinaDataSet)
End Sub
Me.TbmahasiswaBindingSource.RemoveCurrent()
Me.TableAdapterManager.UpdateAll(Me.DbrinaDataSet)
End Sub
8. Tombol Update
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Me.TbmahasiswaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DbrinaDataSet)
End Sub
0 komentar:
Posting Komentar