Skip to main content

Tutorial-03 Membuat List Data

Masih menggunakan form yang sama dengan Tutorial-01 namun dengan adanya Tutorial-02 data pada List sudah bisa di input paling tidak dengan ilustrasi data seperti dibawah ini


Public Class APLIKASI

  Inherits System.Windows.Forms.Form
  Dim DABARANG As OleDb.OleDbDataAdapter

  Private Sub APLIKASI_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated

  DABARANG = New OleDb.OleDbDataAdapter("SELECT IDUSER,USERNAME,PASSWORD,AUTHENTIFIKASI" & _
  " FROM TABEL_USER_SISTEM", MyKoneksi.KONEKSI_DBMS)

  Dim DTBARANG As New DataTable
  DTBARANG.Clear()
  DABARANG.Fill(DTBARANG)

  Me.GRIDUSER.DataSource = DTBARANG
  Me.GRIDUSER.ReadOnly = True

  End Sub
************************************************************************
  Private Sub GRIDUSER_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles GRIDUSER.DoubleClick

  USER.TxtIDUSER.Text = GRIDUSER.Item(0, GRIDUSER.CurrentRow.Index).Value
  USER.TxtUSERNAME.Text = GRIDUSER.Item(1, GRIDUSER.CurrentRow.Index).Value
  USER.TxtPASSWORD.Text = GRIDUSER.Item(2, GRIDUSER.CurrentRow.Index).Value
  USER.CmbLEVEL.Text = GRIDUSER.Item(3, GRIDUSER.CurrentRow.Index).Value

  Me.Hide()
  USER.Show()

  End Sub
**************************************************************************
  Private Sub GRIDUSER_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GRIDUSER.KeyDown

  If e.KeyCode = Keys.Enter Then
  USER.TxtIDUSER.Text = GRIDUSER.SelectedCells.Item(0).Value
  USER.TxtUSERNAME.Text = GRIDUSER.SelectedCells.Item(1).Value
  USER.TxtPASSWORD.Text = GRIDUSER.SelectedCells.Item(2).Value
  USER.CmbLEVEL.Text = GRIDUSER.SelectedCells.Item(3).Value

  Me.Hide()
  USER.Show()
  End If

  End Sub

End Class


Comments

Popular posts from this blog

Pop Up message Visual Studio "The operation could not be completed. The process cannot access the file because it is being used by another process"

Run your Visual Studio as Administrator account

Create Comment As .xls In Farpoint Spread

  Private Sub TAGS_PARENTING()         Dim DTPopUp As New DataTable         With DTPopUp             .Columns.Add("SEQ", GetType(String))             .Columns.Add("QTY", GetType(String))             .Columns.Add("ETD", GetType(String))             .Columns.Add("ETA", GetType(String))             DTPopUp = MePostab_Control.Cari_TAG_PARENTING         End With         With FPPOSTAB             For GG As Integer = 0 To .ActiveSheet.RowCount - 1             ...