SHARE
TWEET

FORM KONTAK PEGAWAI

a guest Aug 7th, 2018 156 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Data.OleDb
  2. Public Class KONTAK_PEGAWAI
  3.     Sub grid()
  4.         ' Me.DataGridView1.Columns(0).HeaderText = "NIP"
  5.         '  Me.DataGridView1.Columns(1).HeaderText = "NAMA"
  6.         'Me.DataGridView1.Columns(2).HeaderText = "NOMOR HP"
  7.         '  DataGridView1.Columns(3).HeaderText = "EMAIL"
  8.         ' DataGridView1.Columns(4).HeaderText = "ALAMAT"
  9.         DataGridView1.Columns(0).Width = 100
  10.         DataGridView1.Columns(1).Width = 100
  11.         DataGridView1.Columns(2).Width = 80
  12.         DataGridView1.Columns(3).Width = 100
  13.         DataGridView1.Columns(4).Width = 100
  14.         '  DataGridView1.Columns(5).Width = 100
  15.         '  DataGridView1.Columns(0).HeaderText = "NAMA"
  16.         ' DataGridView1.Columns(1).HeaderText = "KENAIKAN PANGKAT"
  17.  
  18.     End Sub
  19.     Sub tampilkan()
  20.         Call KoneksiDb()
  21.         DA = New OleDb.OleDbDataAdapter("select NIP ,Nama , No_hp, Email, Alamat from karyawan", CNN)
  22.         DS = New DataSet
  23.         DA.Fill(DS)
  24.         DataGridView1.DataSource = DS.Tables(0)
  25.         DataGridView1.ReadOnly = True
  26.     End Sub
  27.     Private Sub KONTAK_PEGAWAI_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  28.         Call tampilkan()
  29.         Call KoneksiDb()
  30.         Call grid()
  31.     End Sub
  32.  
  33.     Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
  34.         DataGridView1.Rows(e.RowIndex).HeaderCell.Value = CStr(e.RowIndex + 1)
  35.     End Sub
  36.  
  37.     Private Sub DataGridView1_CellMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseDoubleClick
  38.         Try
  39.             EDITKONTAKPEGAWAI.Show()
  40.             EDITKONTAKPEGAWAI.TextBox1.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value
  41.             EDITKONTAKPEGAWAI.TextBox2.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value
  42.             EDITKONTAKPEGAWAI.TextBox3.Text = DataGridView1.Rows(e.RowIndex).Cells(3).Value
  43.             EDITKONTAKPEGAWAI.TextBox4.Text = DataGridView1.Rows(e.RowIndex).Cells(4).Value
  44.             EDITKONTAKPEGAWAI.TextBox5.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value
  45.         Catch ex As Exception
  46.             MsgBox("TIDAK ADA DATA")
  47.         End Try
  48.     End Sub
  49.  
  50.     Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
  51.  
  52.     End Sub
  53. End Class
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top