Professional Documents
Culture Documents
Modul belajar sendiri, dibuat sendiri & untuk yang mau belajar sendirian aja..
VBNet 2005
&
SQL 2005
Page |1
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
10-juni-2012
(b)
Page |2
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
DAFTAR ISI
Page |3
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
KONTAK:
Stttt..... foto ini harap di rahasiakan, tidak semua orang tahu akan hal ini.. apalagi media Infotaiment
Page |4
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
KONTAK ANE:
Im3:
0857.73.59.59.69
(terima Transafer PULSA, yg transfer pulsa akan ane catat NAMA+KELAS nya.. hehehehe)
Indraes.ok@ gmail.com
yang mau curhat, konsultasi pemograman bias sms/telp/imel/fb inbox ane...
Page |5
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
foto-foto keren:
Page |6
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Page |7
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Web ane :
www.mysystem-indonesia.com
web yang menjual program untuk perusahaan manufacture | masih
BETA
Page |8
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Page |9
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
VB Net
P a g e | 10 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 11
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
VERSI DATABASE SQL SERVER (GRATIS tidak perlu bayar LISENSI): 1. SQL server 2005 EXPRESS ringan digunakan dibandingkan 2008 2. SQL server 2008 EXPRESS
Ket: Microsoft memang mengeluarkan versi EXPRESS, jadi FREE, tidak perlu bayar, bebas digunakan untuk akademis, pribadi ataupun bisnis.. (Lumayan)
P a g e | 12
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
File utama project VBNet mempunyai EXTENTION = VBPROJ (kalo di VB6: ber-extensi .VBP)
P a g e | 13
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P e n t I n g (Start-up form)
RUNNING
1 2
1. Klik 2x My Project , atau dari menu = PROJECT + PROPERTIES 2. Muncul form diatas. Pilih START-UP FORM, pilih form nya deh..
P a g e | 14
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 15
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Mouse,Cursor,Bersihkan data
MOUSE : MERUBAH BENTUK MOUSE SAAT PROSES Screen.MousePointer = vbHourglass System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Help
TextBox1.Focus()
.atau
P a g e | 16
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
COMBO Box
COMBO BOX Combo1.Clear Combo1.AddItem IT Combo2.AddItem OM ComboBox1.Items.Clear ComboBox1.Items.Add(IT) ComboBox1.Items.Add(OM)
M s g B o x, I n p u t B o x
KOTAK PESAN MASIH SAMA, SEDIKIT BEDA UNTUK ICON DAN KOTAK Contoh : Dim Tanya As String Tanya=Msgbox(INGIN KELUAR?,VbQuestion+VbYesNo) Tanya = MsgBox("KELUAR?", MsgBoxStyle.Question + MsgBoxStyle.YesNo) If Tanya=VbYes Then If Tanya = vbYes Then Unload me Me.Close() End if End If Bentuk lain;
P a g e | 17
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
MessageBoxButtons.OK, MessageBoxIcon.Information)
KOTAK INPUTBOX MASIH SAMA Nama=Inputbox (Nama kamu sapaaa?) MsgBox nama,VbInformation
Code ERROR
ERROR On Error resume next Atau: On Error Goto Cek .. .. Exit sub Cek: Msgbox ERR.Description Code yang lama bisa digunakan: ON ERROR RESUME NEXT On Error Goto Cek .. .. Exit Sub Cek: Msgbox ERR.Description Code baru: Try ' ---kode yg ingin di cek ' ... Catch e As Exception ' Handle any exceptions. ' ... Finally ' The stream should be closed whether or not error End Try
Yang lama bisa di gunakan: Label1.Text = Format(Jml, "#,##0") Yang Baru: Dim a As String = 100000 Me.Text = FormatNumber(a) 100,000.00 Me.Text = FormatNumber(a,4) 100,000.0000 Me.Text = FormatNumber(a,0) 100,000
Msgbox DATE
P a g e | 18
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Msgbox Format(DATE,dd-MMMyyyy)
HH:MM Me.Text = "LongTime :" & FormatDateTime(Now, DateFormat.LongTime) HH:MM:SS Me.Text = "ShortDate :" & FormatDateTime(Now, DateFormat.ShortDate) ddMMM-yyyy Me.Text = FormatDateTime(Now, DateFormat.LongDate) dd-MMMM-yyyy Me.Text = "GeneralDate :" & FormatDateTime(Now, DateFormat.GeneralDate) dd-MMMM-yyyy HH:MM:SS
Format (DATE,dd) Format (DATE,MMM) Format(DATE,yyyy) Msgbox Day(Date)/ Month(Date)/ Year(Date) Msgbox Hour(Time)/ Minute(Time)/ Second(Time)
Me.LBL_jam.Text = Now dd-MMM-yyyy HH:MM:SS Me.Label8.Text = "Now.date :" & Now.Date dd-MMM-yyyy Me.Label9.Text = "Now.day :" & Now.Day dd Me.Label10.Text = "Now.month :" & Now.Month mm Me.Label11.Text = "Now.year :" & Now.Year yyyy Me.Label12.Text Me.Label13.Text Me.Label14.Text Me.Label15.Text = = = = "Now.hour :" & Now.Hour HH "Now.minute :" & Now.Minute MM "Now.second :" & Now.Second SS "Now.Millisecond :" & Now.Millisecond Milisecond /1000
Me.Label16.Text = "Now.DayOfWeek :" & Now.DayOfWeek urutan hr dlm 1 mg (SENIN=1, SELASA=2, MINGGU=7) Me.Label22.Text = "Now.DayOfYear :" & Now.DayOfYear urutan hr dlm 1 thn
FUngsi FORMAT masih bisa digunakan
M D I Form
MDI : MEMBUAT FORM PARENT MDI
-Buka FORM + (PROPERTIES) .IsMDIContainer = TRUE -form ini dijadikan form UTAMA yang menaggil FORM2 lainnya, pada saat memanggil FORM lainnya yg akan di jadikan MDI CHILD bari diketikkan KODE dibawah ini
MDI : MEMBUAT FORM CHILD MDI -Buka FORM + (PROPERTIES) .MDIChild = TRUE
-Membuat FORM menjadi MDI CHILD dengan CODE, bukan dengan mengatur PROPERTIES. Tapi dengan CODE sbb: Code FORM MDI Child: Dim MyChild As New Form1 MyChild.MdiParent = Me MyChild.Show() MyChild.Text = "Halo ini Form MDI Child" -Code di letakkan di PEMANGGILAN FORM, misalnya pada MENU yang memanggil/memunculkan FORM, FORM yg muncul jadi MDI -FORM yg memanggil jadi FORM PARENT
P a g e | 19
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
PopUpMenu MenuReport
Jika di di form ,maka MUNCUL FLOATING menu Floating menu memerlukan componen CONTEXTMENUSTRIP Me.ContextMenuStrip1.Show(System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y) kalo CODE untuk MENG-AKTIF kan salah satu MENU= DataMasterToolStripMenuItem.ShowDropDown()
P a g e | 20
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Untuk membuat PROJECT BARU : klik CREATE PROJECT Untuk membuka PROJECT : klik OPEN PROJECT atau biasanya sudah ada daftar diatas jadi tinggal di klik aja Lalu muncul kotak NEW Project
P a g e | 22
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
1 2 3
1. 2. 3. 4.
Ketik nama FILE PROJECT nya Tentukan LOKASI tempat folder nya, klik tombol BROWSE Jika sudah klik TOMBOL OK Program visual basic Net sudah siap dehhhhhhhhh..
P a g e | 23
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Latihan 1
Materi yang di dapat
1. 2. 3. 4. 5. Fungsi mengosongkan textbox Ber-pindah antar TEXTBOX (di ENTER) atau fungsi TAB INDEX Menggunakan perintah ISNUMERIC untuk cek angka Format angka RIBUAN dan DESIMAL dg FORMAT() Keluar form dengan KONFIRMASI pertanyaan
Keterangan
P a g e | 24
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SETINGAN PROPERTIES:
LABEL
Properties TEXT AUTOSIZE=False BACKCOLOR=Transparant TEXTALIGNMENT IMAGE IMAGEALIGMENT Keterangan Untuk ngetik text nya Agar bias dirubah ukurannya Agar backgraound warna transparan Jenis kerataan/ posisi Untuk ambil/memberi gambar pada label Untuk posisi gambar
PICTUREBOX
Terkadang object di VBNET mucul SEGITIGA KECIL, ini adalah setingan pokok
TEXTBOXBOX
Properties TEXT FONT FORECOLOR MAXLENGTH PASSWORD CHART Keterangan Untuk ngetik text nya Pengaturan huruf (model,efek,dll) Warna huruf Panjang maximal input data Symbol untuk password agar tidak terbaca
BUTTON
Properties TEXT TEXT ALIGMENT IMAGE IMAGE ALIGMENT P a g e | 25 Untuk ngetik text nya Posisi text Ambil gambar Posisi gambar modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012 Keterangan
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE-CODE PROCEDURE:
Procedure kosong untuk mengosongkan textbox
Sub KOSONG()
Me.TextBox1.Clear() Me.TextBox2.Clear() Me.TextBox3.Text=
END SUB
CODE-CODE :
Code: TOMBOL KOSONG
CALL KOSONG Me.TextBox1. '/ panggil procedure kosongkan textbox
Focus()
Close()
Catatan:
Me.CLOSE END
P a g e | 26
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Val(Me.TextBox1.Text)
Val(Me.TextBox2.Text)
IsNumeric
fungsi untuk cek apakah yg di input angka numeric?
= False Then MsgBox("INPUT DATA DENGAN ANGKA..", MsgBoxStyle.Information) Me.TextBox4.Focus() Exit Sub End If If IsNumeric(Me.TextBox5.Text) = False Then MsgBox("INPUT DATA DENGAN ANGKA..", MsgBoxStyle.Information) Me.TextBox5.Focus() Exit Sub /keluar dari sub kembali ke form End If Me.TextBox3.Text = Val(Me.TextBox1.Text) - Val(Me.TextBox2.Text)
IsNumeric(Me.TextBox4.Text)
Format fungsi
format angka, tgl, jam, dll
Format(MANIS_deh, "#.00")
P a g e | 27
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 28
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
UPGRADE code:
Kode lainnya;
P a g e | 29
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 30
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 31
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Langkahnya: 1. Aturlah TAB INDEX di PROPERTIES disetiap TEXTBOX menjadi urutan. Urutan ini dijadikan URUTAN PINDAH CURSOR. (dari: 1,2,3,4seterusnya)
P a g e | 32
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
3 4
2
..begitu seterusnya, buatlah urutan angka di TABINDEX sbg inisial urutan perpindahan cursor nya Code:
SendKeys.Send("{TAB}")
End If
P a g e | 33
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SendKeys.Send("{TAB}")
P a g e | 34
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Untuk berpindah cursor dengan menggunakan ENTER (bukan sendkeys) tidak ada yang diatur, langsung di ketik CODE nya di setiap TEXTBOX nya Text1 ke text2
Text2 ke text3
P a g e | 35
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Latihan 2
Materi yang di dapat
1. 2. 3. 4. Buatlah form untuk input nilai siswa Gunakan ENTER untuk pindah antar textbox Gunakan fungsi ISNUMERIC untuk cek input angka
Keterangan
Keterangan: 1.COMBO JURUSAN = INFORMATION TEHNOLOGY, MANAJEMEN INFORMATIKA, 2. hitunglah: TOTAL NILAI = (nilai inggris+vb+sisco) 3. hitunglah: RATA RATA = TOTAL NILAI / 3 4. hitunglah: KETERANGAN: a. jika RATA RATA 61-100 LULUS b. jika RATA RATA 49 60 HER P a g e | 36 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
5. Buatlah PROCEDURE KOSONG untuk mengosongkan textbox 6. Gunakan fungsi ISNUMERIC untuk mengecek angka yang di input di TEXT2, TEXT3, TEXT4
P a g e | 37
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Latihan 3.
Materi yang di dapat
1. 2. 3. Ambil tanggal dan jam Memisahkan TAHUN, BULAN, HARI, JAM , MENIT, DETIK Selisih tanggal dan jam
Keterangan
P a g e | 38
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
PROPERTIES: DateTimePicker untuk TANGGAL .Format=Custom, CustomFormat=dd/MMM/yyyy DateTimePicker untuk JAM .Format=Custom, CustomFormat=HH:mm:ss
P a g e | 39
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Me.TextBox8.Text = TANGGAL_JAM.Day Me.TextBox9.Text = Format(Now, "dddd") Me.TextBox10.Text Me.TextBox11.Text Me.TextBox12.Text Me.TextBox13.Text Me.TextBox14.Text = = = = = Format(Now, "HH:mm:ss") TANGGAL_JAM.Hour TANGGAL_JAM.Minute TANGGAL_JAM.Second TANGGAL_JAM.Millisecond
P a g e | 40
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/--------------------------------------------------/ '/metode lain dengan fungsi , hasilnya sama '/--------------------------------------------------/ MsgBox("sekarang dengan fungsi DateAdd....") TGL = Now 'ambil tgl TAHUN_maju = DateAdd("yyyy", Val(Me.TextBox15.Text), TGL) 'majukan tahun Me.TextBox16.Text = TAHUN_maju.Date 'tampilkan
DATEADD
P a g e | 41
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Dim BULAN_maju As Date TGL = Now BULAN_maju = TGL.AddMonths(Me.TextBox17.Text) Me.TextBox18.Text = BULAN_maju.Date 'ambil tgl komputer 'majukan tahun 'tampilkan
'/--------------------------------------------------/ '/metode lain dengan fungsi DATEADD, hasilnya sama '/--------------------------------------------------/ MsgBox("sekarang dengan fungsi DateAdd....") TGL = Now BULAN_maju = DateAdd("m", Val(Me.TextBox17.Text), TGL) Me.TextBox18.Text = BULAN_maju.Date
'/--------------------------------------------------/ '/metode lain dengan fungsi DATEADD, hasilnya sama '/--------------------------------------------------/ MsgBox("sekarang dengan fungsi DateAdd....") TGL = Now HARI_maju = DateAdd("d", Val(Me.TextBox19.Text), TGL) Me.TextBox20.Text = HARI_maju.Date
P a g e | 42
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/--------------------------------------------------/ '/metode lain dengan fungsi DATEADD, hasilnya sama '/--------------------------------------------------/ MsgBox("sekarang dengan fungsi DateAdd....") TGL = Format(Now, "HH:mm:ss") JAM_maju = DateAdd("h", Val(Me.TextBox22.Text), TGL) Me.TextBox23.Text = Format(JAM_maju, "HH:mm:ss")
P a g e | 43
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/--------------------------------------------------/ '/metode lain dengan fungsi DATEADD, hasilnya sama '/--------------------------------------------------/ MsgBox("sekarang dengan fungsi DateAdd....") TGL = Format(Now, "HH:mm:ss") MENIT_maju = DateAdd("n", Val(Me.TextBox24.Text), TGL) Me.TextBox25.Text = Format(MENIT_maju, "HH:mm:ss")
P a g e | 44
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
TOMBOL EXIT:
P a g e | 45
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
INFORMASI: Untuk perintah MAJU MUNDUR TANGGAL bisa juga menggunakan fungsi DATEADD
P a g e | 46
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Latihan 4. Animasi
Latihan 4 : Animasi
Membuat ANIMASI menggunakan TIMER Membuat TANGGAL dan JAM
Name: MATAHARI
Berkedip-kedip genit
Name: SUPERMEN
Name: KAPAL
P a g e | 47
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 48
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Latihan 5
FORMAT
TIMER1 Tick
FUngsi FORMAT: sangat bermamfaat untuk memformat angka. (format tgl, jam, angka ribuan, angka decimal, dll)
-----AMBIL TGL dan JAM Me.Label1.Text = Format(Now, "dd-MMM-yyyy") Me.Label2.Text = Format(Now, "HH:mm:ss") -----AMBIL TGL, Me.Label5.Text = Me.Label7.Text = Me.Label9.Text = BULAN dan TAHUN TANGGAL Format(Now, "dd") Format(Now, "MMMM") Format(Now, "yyyy")
-----AMBIL JAM, MENIT dan DETIK JAM Me.Label11.Text = Format(Now, "HH") Me.Label13.Text = Format(Now, "mm") Me.Label15.Text = Format(Now, "ss")
P a g e | 49
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE di
Me.Timer1.Enabled = True
CODE di
Me.Timer1.Enabled = False
P a g e | 50
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Untuk latihan MENU, tambahkanlah FORM lagi sebanyak 2 form, jadi sekarang ada 3 FORM AKTIFKAN FORM1 (Klik 2x Form 1) Tambahkan component : MENUSTRIP Form :
P a g e | 52
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 53
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
DATA MOBIL:
P a g e | 54
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Form2.Show()
Form2.ShowDialog()
Code:
P a g e | 55
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
tanya = MsgBox("Mau keluar program", MsgBoxStyle.Question + MsgBoxStyle.YesNo) If tanya = vbYes Then END End If
Code: Msgbox Yang buat keren loh & CHR(13) & Nama nya: INDRA ES , MsgBoxStyle.Information
P a g e | 56
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat TOOLBAR
(ToolStrip)
ToolStrip
Sub Menu
LAYOUT TOOLBAR:
Design toolbar
P a g e | 57
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Lokasi toolbar
DESIGN TOOLSTRIP
Properties:
BUTTON
DISPLAY TYPE FONT : menampilkan gambar saja/ gambar + text / Text saja : jenis huruf
P a g e | 58
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
FORE COLOR IMAGE IMAGE ALIGN IMAGE SCALING TEXT TEXT ALIGN TEXT IMAGE RELATION TOOL TIP TEXT TEXT DIRECTION
: : : : : : : : :
warna huruf mengambil gambar menu lokasi gambar mengatur UKURAN GAMBAR judul huruf lokasi huruf pengaturan LOKASI huruf & gambar keterangan text (saat mouse berada dg toolbar) rotasi huruf
P a g e | 59
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Properties:
: judul menu : atur rata kiri, tengah, kanan text : memunculkan kotak keterangan saat MOUSE berada di MENU
CODE di TOOLSTRIP Untuk mengetikkan CODE di toolstrip, cukup dengan meng-KLIK 2x pada ICON yang dituju, misalnya KLIK 2x pada icon EXIT
Code:
Dim tanya As String tanya = MsgBox("Mau keluar program", MsgBoxStyle.Question + MsgBoxStyle.YesNo) If tanya = vbYes Then END End If
Code: Msgbox Yang buat keren loh & CHR(13) & Nama nya: INDRA ES , MsgBoxStyle.Information
P a g e | 60
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 61
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Jika FORM di KLIK maka akan MUNCUL FLOATING MENU di POSISI KURSOR MOUSE. Untuk membuat MENU ini maka kita butuhkan sebuah MENU KHUSUS dg component CONTEXTMENUSTRIP TAMBAHKAN COMPONEN : ConTextMenuStrip DESIGN: DESIGN menu ini sama dengan design MENU pada MENUSCTIP
CODE untuk MEMUNCULKAN ConTextMenuStrip. Jika TOMBOL KANAN MOUSE di KLIK di FORM
P a g e | 62
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE:
ATAU:
Code:
Dim tanya As String tanya = MsgBox("Mau keluar program", MsgBoxStyle.Question + MsgBoxStyle.YesNo) If tanya = vbYes Then END End If
TAMPILAN Floating Menu saat dijalankan, dan saat MOUSE TOMBOL KANAN di KLIK:
P a g e | 63
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat
MDI FORM
P a g e | 64
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat
1. 2. 3. FORM BIASA (Single Form) MDI Form (MDI PARENT) MDI Child Form
MDI Form
Is MDI Container
TRUE
P a g e | 65
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 66
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE CODE untuk MENAMPILKAN FORM biasa sebagai FORM MDI CHILD CODE:
Dim FormChild As New Form2 FORM2 adalah FORM biasa yg akan di MUNCULKAN FormChild.MdiParent = Me Me Ini bisa di GANTI dengan NAMA MDI PARENT nya, misalnya MDI PARENT namanya Form1: FormChild.MdiParent = Form1
CODE:
CODE:
Me.LayoutMdi(MdiLayout.Cascade)
CODE:
Me.LayoutMdi(MdiLayout. TileVertical)
CODE:
Me.LayoutMdi(MdiLayout. TileHorizontal)
P a g e | 67
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 68
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
WINDOWS VERTICAL
WINDOWS HORIZONTAL
P a g e | 69
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 70
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SELINGAN
Ih.. akang indraES.. cute, mirip Afgan deh..
P a g e | 71
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 72
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 73
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SYSTEM
BENGKEL MOTOR
Indra bengkel + cuci motor selalu bersih dan rapi sekaleeeeeeeeee
P a g e | 74 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SYSTEM BENGKEL
Database SQL Server
DATABASE TABLE : :
BENGKEL
1.PELANGGAN FIELD KODE_PELANGGAN NAMA_PELANGGAN 2.BARANG_JASA FIELD KODE_BARANG_JASA NAMA_BARANG_JASA KATEGORI HARGA STOK 3.SPAREPART_MASUK FIELD NO_MASUK TGL KODE_BARANG NAMA_BARANG JUMLAH 4.SERVICE FIELD NO_SERVICE TGL KODE_PELANGGAN SUBTOTAL_SERVICE DISCOUNT TOTAL_SERVICE 5.SERVICE_RINCIAN FIELD NO_SERVICE KODE_BARANG_JASA NAMA_BARANG_JASA HARGA JUMLAH SUBTOTAL NO_URUT
SIZE 10 50
ALLOWNULL V
KET PrimaryKey
SIZE 10 30 10
ALLOWNULL V V v
KET PrimaryKey
KET PrimaryKey
ALLOWNULL KET 10 V 10 V 30 V default V default V default V default PrimaryKey, Indentity=Yes, Indentity Increment=1
SIZE
P a g e | 75
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 76
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
EXPRESS
P a g e | 77
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Keterangan: Jika menggunakan versi EXPRESS, maka nama server di-ikuti dengan kata2
\SQLEXPRESS
Jadi pada saat pembuatan program sewaktu KONEKSI ke server kata2 \SQLEXPRESS ini ikut juga
P a g e | 78
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat database
Klik KANAN di Database + New Database
P a g e | 79
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 80
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat table
1.Klik KANAN di TABLE + NEW TABLE
P a g e | 81
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
2
3.klik TOMBOL SAVE (disket) jika telah selesai..; ketiklah NAMA TABLENYA PELANGGAN
P a g e | 82
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
1
Muncul grid untuk input data pelanggan
Inputlah table PELANGGAN sbb: 2.Jika telah SELESAI klik tombol PANAH SERU untuk UPDATE/SAVE
P a g e | 83
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 84
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 85
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 86
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
KONEKSI
VBNet DataBase
Ada banyak TEHNIK untuk koneksi dari VBNet ke Database (sama juga di VB6)
P a g e | 87
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Namun untuk LATIHAN KONEKSI kedua cara ini akan diberikan juga, agar warga belajar bisa membuat koneksi dari berbagai jenis tehnik
P a g e | 88
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
ODBC
Membuat koneksi ODBC ke database SQL server 2005
Buka ODBC; control panel + administrative tools + odbc Tampilan ODBC;
3
1. Klik TOMBOL ADD 2.Klik SQL NATIVE client + 3.klik tombol FINISH Info: SQL Native Client SQL2005 SQL server SQL 2000 SQL server native client 10 SQL2008
P a g e | 89
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
6
4.Name (nama odbc nya) : ODBC_BENGKEL 5.Server (nama server): .\SQLEXPRESS 6.Klik TOMBOL NEXT
7
..setingan untuk login ke databasenya, jika database pas di install TIDAK PAKE PASSWORD (atau tidak pake security user database), maka form ini di lewatkan saja.. 7.Klik TOMBOL NEXT
P a g e | 90
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
9
8.pilih nama DATABASE yang akan di gunakan 9.klik tombol NEXT
10
10.klik TOMBOL FINISH
P a g e | 91
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
11
11. klik TOMBOL TEST DATA SOURCE (buat tes hasil koneksi) Selesai Hasilnya
12
12.koneksi OK, klik OK.. OK
P a g e | 92
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 93
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 95
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CONNECTION STRING
Untuk koneksi ke database
Setiap database mempunyai KODE tersendiri yang berbeda untuk koneksi ke database.. Yuuuuuuuuuuuuuuuk kita coba..
2
2.KLIK DATABASE + tombol NEXT
P a g e | 96
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Disini form menampilkan koneksi yg telah kita buat.. jika BELUM ADA KONEKSI/ mau BIKIN BARU klik
5
4.jenis database dan tehnik koneksinya; untuk OLEDB pilihan .NET Framework Data Provider for OLEDB
P a g e | 97
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
6.inputlah NAMA SERVER 7.Pilih NAMA DATABASE jika nama server BETUL,maka akan muncul daftar nama databasenya 8.klik TOMBOL TEST CONNECTION untuk tes koneksi ke database 9.setelah OK, klik TOMBOL OK untuk kembali ke form
P a g e | 98
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
11
Copy-pah kode ini.. blok lalu CTRL-C
10
12
..form kembali kesini 10. bukalah *++Connection string sehingga kode koneksi terlihat..
11.
COPY
12.lalu KLIK TOMBOL CANCEL. Jangan NEXT, karena kita HANYA BUTUH code koneksi nya saja
PASTE
selesai
lah selesai
P a g e | 99
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 100
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
INPUT DATA BARU INSERT INTO nama_table (nama_field1, nama_field2) VALUES (data1, data2)
Untuk DATA pada INSERT INTO
Type data TEXT gunakan KUTIP SATU Type data NUMERIC tidak gunakan apa2 Type data TANGGAL gunakan KUTIP SATU
UPDATE DATA UPDATE nama_table SET Nama_field1 = data1 , Nama_field2 = data2 WHERE Nama_field3 = data3 DELETE DATA DELETE nama_table WHERE Nama_field1 = data3/kondisinya
P a g e | 101
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 102
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
TEORI SEDIKIT
Menampilkan data dg
LISTVIEW
dan TEHNIK
DATAGRIDVIEW
P a g e | 103
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
PENTING
Variable Connection
MENGGUNAKAN LISTVIEW
RS adalah nama variable (RECORDSET) untuk membuka TABLE, TABLE yang akan di BUKA
MENGGUNAKAN DATAGRIDVIEW
perintah SQL (select,Insert,Delete,Update) DataGridView Var tempat menampung hasil sql: SELECT ) DataGridView Public CMD_Adapter As New ODBCDataAdapter
P a g e | 104
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 105
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Ini adalah
P a g e | 106
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Running:
Running :
P a g e | 107
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Data dg ListView
Data dg DataGridView
P a g e | 108
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Tombol_exit
TABControl1
LISTVIEW1
TOMBOL_refresh_ListView
P a g e | 109
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
DATAGRIDVIEW
TOMBOL_refresh_DataGridView
P a g e | 110
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Langkah b:
Membuat
MODUL
P a g e | 111
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di MODULE:
Code di MODULE '/---var.ini untuk proses simpan INPUT/EDIT data
Public STATUS_input_data_baru As Boolean = False
Ket
TRUE=simpan sb input FALSE=simpan sb edit RS bisa banyak, disesuaikan dengan kebutuhan dan jumlah TABLE yg dibuka
Exit Sub CEK: MsgBox(Err.Description, MsgBoxStyle.Information, "CONNECTION ERROR") End End Sub
P a g e | 112
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Public Sub KOSONG(ByVal obj As Object) procedure untuk mengosongkan TextBox For Each ctl As Control In obj.controls If TypeOf ctl Is TextBox Then ctl.Text = "" End If Next End Sub
INFO:
P a g e | 113
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di FORM
P a g e | 114
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat PROCEDURE untuk menampilkan data dari TABLE ke LISTVIEW & DATAGRIDVIEW
Procedure menampilkan data dari TABLE ke LISTVIEW
Langkah c:
Sub TABLE_to_LISTVIEW()
Call BUKA_DB() '>buka koneksi db Dim AA As String = "" AA = " SELECT * FROM PELANGGAN ORDER BY KODE_PELANGGAN" CMD = New Odbc.OdbcCommand(AA, CONN) '>buka koneksi|| RS = CMD.ExecuteReader() With Me.ListView1 .Items.Clear() .FullRowSelect = True .GridLines = True .View = View.Details .AllowColumnReorder = True '/----- Bikin Kolom Sesuai Dg Field Nya .Columns.Clear() .Columns.Add("KODE PELANGGAN", 100) .Columns.Add("NAMA PELANGGAN", 300) End With '>data select dijalankan|| RS.OPEN aa,conn (VB6) '>setting ListView
P a g e | 115
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/-------------------------------------------------------------------------/ '/ Gunakan .Hasrows Untuk Mengecek Jumlah Data Yg Diambil '/ Biasanya Untuk Cek Apakah Table Ada Recordnya.. Cari Data '/-------------------------------------------------------------------------/ If RS.
HasRows
Then
Dim lv As ListViewItem '/----------------------------------------------------------------------/ '/ Gunakan .Read -> Untuk Keperluan LOOPING, '/ Baca Data Dari Awal-Akhir atau BACA HASIL FIELD nya '/----------------------------------------------------------------------/ While RS.
Read
lv = Me.ListView1.Items.Add(RS("KODE_PELANGGAN")) lv.SubItems.Add(RS("NAMA_PELANGGAN")) End While End If RS.Close() CMD.Dispose() End Sub '>tutup recordset || (VB6) Rs.Close '>buang select dr memory || (VB6) set RS=Nothing
Procedure menampilkan data dari TABLE ke DATAGRIDVIEW DATAGRIDVIEW tidak perlu dibuat KOLOM untuk lokasi field table, karena secara OTOMATIS data yang dibaca akan menjadi KOLOM
Sub TABLE_to_GRID()
Call BUKA_DB() Dim BB As String = "" BB = "SELECT * FROM PELANGGAN ORDER BY KODE_PELANGGAN " CMD_Adapter = New Odbc.OdbcDataAdapter(BB, CONN) '>buka Conn
P a g e | 116
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Dim RS_Table As New DataTable RS_Table.Clear() CMD_Adapter.Fill(RS_Table) With Me.DataGridView1 .DataSource = RS_Table
'>hapus dr memori
P a g e | 117
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat PROCEDURE untuk menampilkan data dari LISTVIEW & DATAGRIDVIEW ke FORM
Procedure menampilkan data dari LISTVIEW FORM
Langkah d:
Sub LISTVIEW_to_FORM()
On Error Resume Next Me.TextBox1.Text = Me.ListView1.FocusedItem.Text Me.TextBox2.Text = Me.ListView1.FocusedItem.SubItems(1).Text End Sub
Sub GRID_to_FORM()
On Error Resume Next Me.TextBox1.Text = Me.DataGridView1.Item(0, Me.DataGridView1.CurrentRow.Index).Value Me.TextBox2.Text = Me.DataGridView1.Item(1, Me.DataGridView1.CurrentRow.Index).Value End Sub
P a g e | 118
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Langkah e:
Sub TABLE_to_LISTVIEW_INTERAKTIF()
Call BUKA_DB() '>buka koneksi db Dim AA As String = "" AA = "SELECT * FROM PELANGGAN " & _ " WHERE NAMA_PELANGGAN LIKE '%" & Trim(Me.TXT_CARI_listview.Text) & "%'" & _ " ORDER BY NAMA_PELANGGAN " CMD = New Odbc.OdbcCommand(AA, CONN) RS = CMD.ExecuteReader() With Me.ListView1 .Items.Clear() .FullRowSelect = True .GridLines = True .View = View.Details .AllowColumnReorder = True '/----- Bikin Kolom Sesuai Dg Field Nya .Columns.Clear() .Columns.Add("KODE PELANGGAN", 100) .Columns.Add("NAMA PELANGGAN", 300) End With '>jalankan select
P a g e | 119
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/-------------------------------------------------------------------------/ '/ Gunakan .Hasrows Untuk Mengecek Jumlah Data Yg Diambil '/ Biasanya Untuk Cek Apakah Table Ada Recordnya.. Cari Data '/-------------------------------------------------------------------------/ If RS.
HasRows
Then
Dim lv As ListViewItem '/-----------------------------------------------------------------/ '/ Gunakan .Read -> Untuk Keperluan LOOPING, '/ Baca Data Dari Awal-Akhir '/-----------------------------------------------------------------/ While RS.
Read
'>tutup recordset
Sub TABLE_to_GRID_INTERAKTIF()
Call BUKA_DB() Dim BB As String = "" BB = "SELECT * FROM PELANGGAN " & _ " WHERE Nama_Pelanggan LIKE '%" & Trim(Me.TXT_CARI_datagridview.Text) & "%'" & _ " ORDER BY NAMA_PELANGGAN " P a g e | 120 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CMD_Adapter = New Odbc.OdbcDataAdapter(BB, CONN) Dim RS_Table As New DataTable RS_Table.Clear() CMD_Adapter.Fill(RS_Table) With Me.DataGridView1 .DataSource = RS_Table '>siapkan var penampung
'>buka Conn
'>hapus dr memori
P a g e | 121
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di FORM
Langkah f:
TOMBOL_refresh_ListView - Click
Refresh listview
Call TABLE_to_LISTVIEW()
Code:
TOMBOL_refresh_DataGridView - Click
Refresh grid
Call TABLE_to_GRID()
Code di TEXTBOX:
Code:
TXT_CARI_listview - TextChanged
Cari interaktif
Call TABLE_to_LISTVIEW_INTERAKTIF()
P a g e | 122
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code:
TXT_CARI_datagridview - TextChanged
Cari interaktif
Call TABLE_to_GRID_INTERAKTIF()
ListView1 - SelectedIndexChanged
LISTVIEW FORM
Call LISTVIEW_to_FORM()
Code:
DataGridView1 - SelectionChanged
GRID FORM
Call GRID_to_FORM()
P a g e | 123
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 124
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Langkah g:
Tombol_DEL
Tombol_FIND
Tombol_EXIT
P a g e | 125
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
TOMBOL_FIND Click
Refresh listview
Dim CARI As String = InputBox("MASUKKAN KODE PELANGGAN :") If CARI = "" Then Exit Sub End If Call BUKA_DB() Dim AA As String
AA= "SELECT * FROM PELANGGAN " & _ " WHERE KODE_PELANGGAN='" & Trim(CARI) & "' "
CMD = New Odbc.OdbcCommand(AA, CONN) RS = CMD.ExecuteReader() '/------------------------------------------------------------------------------/ '/ Untuk Membaca Hasil Data Pake Kode Dr.Read '/------------------------------------------------------------------------------/ If RS.Read Then Me.TextBox1.Text = RS("KODE_PELANGGAN") Me.TextBox2.Text = RS("NAMA_PELANGGAN") MsgBox("ADA", MsgBoxStyle.Information, "Cari") Else '/--- Data Tidak Ada (dr.read = FALSE) MsgBox("DATA TIDAK ADA", MsgBoxStyle.Information, "Cari") End If RS.Close() CMD.Dispose() STATUS_input_data_baru = False
P a g e | 126
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code:
TOMBOL_DELETE - Click
HAPUS DATA
'/---cek,apakah data sudah ada,dipilih If Me.TextBox1.Text = "" Then MsgBox("DATA BELUM DIPILIH..", MsgBoxStyle.Information, "Info") Exit Sub End If Dim TANYA As String TANYA = MsgBox("APAKAH DATA AKAN DI HAPUS?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "Tanya") If TANYA = vbNo Then MsgBox("BATAL.....", MsgBoxStyle.Information, "Cancel") Exit Sub End If
Nyambung
CMD.ExecuteNonQuery()
CMD.Dispose() Call Kosong(me) Me.TextBox1.Enabled = False
P a g e | 127
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 128
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 129
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Langkah g:
Tombol_CANCEL
Tombol_EXIT
Tombol_NEW
Tombol_SAVE
Tombol_DEL
Tombol_FIND
P a g e | 130
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di FORM:
Code:
TOMBOL_CANCEL Click
Untuk membatalkan input data
Call TOMBOL_hidup() Call Kosong(ME) '--nonaktifkan lagi textbox1 karena PRIMARY KEY Me.TextBox1.Enabled = False STATUS_input_data_baru = False MsgBox("BATAL..", MsgBoxStyle.Information, "Cancel")
Code:
TOMBOL_NEW Click
Untuk input data baru
STATUS_input_data_baru = True
Call TOMBOL_mati() Call Kosong(ME)
Code:
TOMBOL_SAVE Click
Untuk menyimpan data
'--cek, apakah data PRIMARY KEY sudah di input If Trim(Me.TextBox1.Text) = "" Then MsgBox("DATA HARUS DI ISI", MsgBoxStyle.Information, "Error") Exit Sub End If
P a g e | 131
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 132
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
INSERT INTO
" (KODE_PELANGGAN, NAMA_PELANGGAN) " & _ " VALUES " & _ " ('" & Me.TextBox1.Text & "'," & _ " '" & Me.TextBox2.Text & "')"
CMD = New Odbc.OdbcCommand(AA, CONN) CMD.ExecuteNonQuery() CMD.Dispose()
Else
UPDATE
PELANGGAN SET " & _ " KODE_PELANGGAN ='" & Trim(Me.TextBox1.Text) & "', " & _ " NAMA_PELANGGAN ='" & Trim(Me.TextBox2.Text) & "' " & _ " WHERE KODE_PELANGGAN ='" & Trim(Me.TextBox1.Text) & "' "
CMD.ExecuteNonQuery()
CMD.Dispose() P a g e | 133 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
End If Call TOMBOL_hidup() Me.TextBox1.Enabled = False MsgBox("DATA TELAH DI SIMPAN..", MsgBoxStyle.Information, "Simpan") Call TABLE_to_LISTVIEW() Call TABLE_to_GRID() '/up to date kan Listview & DataGridView
'/jangan lupa untuk merubah status menjadi FALSE '/jadi jika TRUE untuk input data baru, selain itu false STATUS_input_data_baru = False
Sub TOMBOL_hidup()
With Me .TOMBOL_new.Visible = True .TOMBOL_save.Visible = True .TOMBOL_cancel.Visible = False .TOMBOL_del.Visible = True .TOMBOL_find.Visible = True .TOMBOL_exit.Visible = True End With End Sub
Sub TOMBOL_mati()
P a g e | 134
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
With Me .TOMBOL_new.Visible = False .TOMBOL_save.Visible = True .TOMBOL_cancel.Visible = True .TOMBOL_del.Visible = False .TOMBOL_find.Visible = False .TOMBOL_exit.Visible = False End With End Sub
Code di FORM
FORM Load
'/jangan lupa untuk merubah status menjadi FALSE '/jika TRUE untuk INPUT DATA BARU (New), '/jika FALSE buat EDIT/DELETE STATUS_input_data_baru = False '/panggil procedure untuk menampilkan data di Listview,Grid Call BUKA_DB() Call TABLE_to_LISTVIEW() Call TABLE_to_GRID()
Selesai coding..
P a g e | 135
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 136
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 137
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat
REPORT
Dg Crystal Report + ODBC
P a g e | 138 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
DESIGN FORM:
P a g e | 139
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Ini
CODE di FORM
Code di :
TOMBOL REPORT
Dim Laporan As New CrystalReport1 If Me.RadioButton1.Checked = True Then Laporan.RecordSelectionFormula = "" End If If Me.RadioButton2.Checked = True Then
Nyambung jd 1 baris
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di :
FORM - RESIZE
P a g e | 141
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Design Report
P a g e | 142
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
2 3
Klik
+ ODBC
P a g e | 143
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
4 5 6
P a g e | 144
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
9 8
Pilih TABLE nya
10
11 12
Selesai
P a g e | 145
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Aktifkan ruang REPORT FOOTER dg cara: KLIK KANAN di Kotak report footer + DONT SUPPRESS
Jadi sbb:
P a g e | 146
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Selesai
Beberapa settingan
P a g e | 147
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Crystal Report
P a g e | 148 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
REPORT HEADER
(data/judul hanya dicetak di atas 1x di awal report)
PAGE HEADER
(data/judul di cetak di atas setiap halaman)
GROUP Header
GROUP Footer
DETAIL
(data yang di cetak berulang sampai selesai)
P a g e | 149
modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012 REPORT FOOTER
(data/judul hanya dicetak di akhir data habis/selesai)
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Special Field.
Fungsi2 yg siap digunakan dl report
P a g e | 150
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Ukuran Kertas
P a g e | 151
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
[Non-aktifkan Use Default Margins jika ingin merubah2 ukuran margin nya]
P a g e | 152
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
[ pilih FIELD yang akan di URUTKAN, lalu klik tanda panah > atau KLIK 2x ]
P a g e | 153
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Buatlah koneksi ulang dg Klik Create New Connection, setelah selesai klik UPDATE
Selesai P a g e | 154 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 155
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
KERTAS FOLIO
mencetak SURAT JALAN.
, biasanya untuk
Karena kita membutuhkan UKURAN KERTAS yang tidak standard maka kita harus membuat terlebih dahulu UKURAN KERTAS yang di inginkan.. Langkah sbb : 1. Buka Control Panel + Double klik Printer and Faxes 2. Klik menu File > Server Properties 3. Di Tab Forms...pilih Create a new form 4. Masukkan nama ukuran kertas pada text box Form Name...beri nama misalkan : SETENGAHFOLIO (nama bebas) 5. Tentukan satuan unitnya. Bisa dalam cm atau inch 6. Klik tombol Save Form
6 4 3
5
Nanti di CRYSTAL REPORT tinggal di SETTING UKURAN/JENIS KERTAS nya (lihat Setting ukuran kertas halaman 102)
P a g e | 156
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 157
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Menggunakan
P a g e | 158
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE CODE:
Code:
TOMBOL NEW
'/KOSONGIN Me.TextBox1.Clear() Me.TextBox2.Clear() Me.TextBox3.Clear() Me.TextBox4.Clear() Me.ComboBox1.Text = "" Me.TextBox1.Focus()
P a g e | 159
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code:
TOMBOL SAVE
Call BUKA_DB()
/ panggil SP : SP_BARANG_INPUT
Dim CMD As OdbcCommand = New OdbcCommand("{ CALL sp_barang_input(?,?,?,?,?) }", CONN) CMD.CommandType = CommandType.StoredProcedure
/ jalankan SP
CMD.ExecuteNonQuery() MsgBox("OK", MsgBoxStyle.Information) Keterangan:
P a g e | 160
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code:
TOMBOL UPDATE
Call BUKA_DB()
/ panggil SP : SP_BARANG_UPDATE
Dim CMD As OdbcCommand = New OdbcCommand("{ CALL sp_barang_update(?,?,?,?,?) }", CONN)
CMD.CommandType = CommandType.StoredProcedure
/ jalankan SP
CMD.ExecuteNonQuery() MsgBox("OK", MsgBoxStyle.Information)
Code:
TOMBOL FIND
Dim CARI As String CARI = InputBox("Input kode barang :") If CARI = "" Then Exit Sub End If
/ mulai kode SP
Call BUKA_DB()
/ panggil SP : SP_BARANG_CARI
Dim CMD As OdbcCommand = New OdbcCommand("{ CALL sp_barang_cari(?) }", CONN) CMD.CommandType = CommandType.StoredProcedure
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code:
TOMBOL DELETE
/ mulai kode SP
Call BUKA_DB()
/ panggil SP : SP_BARANG_HAPUS
Dim CMD As OdbcCommand = New OdbcCommand("{ CALL sp_barang_hapus(?) }", CONN) CMD.CommandType = CommandType.StoredProcedure
/ jalankan SP
CMD.ExecuteNonQuery() CMD.Dispose()
P a g e | 162 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Me.TextBox1.Text = "" Me.TextBox2.Text = "" Me.ComboBox1.Text = "" Me.TextBox3.Text = "" Me.TextBox4.Text = "" MsgBox("DATA TELAH DI HAPUS..", MsgBoxStyle.Information)
Selesai
P a g e | 163
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 164
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 165
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 166
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
>> ..Programmability + Store Procedure (KLI KANAN + New Stored Procedure) + muncul kotak..bersihkanlah (hapus semua kode2 default) terlebih dabulu kotak kode SP tsb.. +code SP siap di ketik
Jika sudah mengetik SP, jalankan SP tsb.. dengan KLIK ICON EXECUTE..
P a g e | 167
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE ALTERNATIF SP
Code cepat menjalan SP & TIDAK membedakan jenis koneksi
Datanya = "exec SP_BARANG_INPUT " & _ " '" & TextBox1.Text & "'" & _ " ,'" & TextBox2.Text & "' " & _ Kode langsung memanggil SP nya ,dengan perintah " ,'" & ComboBox1.Text & "' " & _ EXEC " ,'" & TextBox3.Text & "' " & _ Perintah ini (EXEC) = " ,'" & TextBox4.Text & "' " adalah PERINTAH untuk
Dim cmd As New Odbc.OdbcCommand(Datanya, CONN) cmd.ExecuteNonQuery() MsgBox("OK", MsgBoxStyle.Information)
SP_BARANG_INPUT adalah nama SP
menjalankan SP langsung lewat SQL nya
P a g e | 168
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 169
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 170
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Ket: 1. 2. 3. COMBOBOX TAHUN GAJI isi dengan urutan tahun COMBOBOX BULAN; isi dengan angka bulan= 1...12 COMBOBOX NAMA DOSEN; isi dengan nama dosen Nama dosen Honor per sks IBU DEWI 100000 BPK JOKO 125000 BPK AMIR 125000 HONOR PER SKS ;munculkan otomatis sesuai dengan nama dosennya, saat di klik combo dosen COMBOBOX MATAKULIAH; isi dengan nama2 mata kuliah= VB, LINUX,OFFICE JUMLAH SKS MENGAJAR; di input bebas POTONGAN; adalah potongan honor, diinput bebas (missal potongan koperasi, dll) TOTAL HONOR = (Honor per sks * Jumlah sks mengajar ) Potongan
4. 5. 6. 7. 8. Tombol: 1. Tombol NEW; mengosonkan textbox dan combobox 2. Tombol SAVE, FIND, DELETE; gunakan Store procedure untuk simpan,cari dan hapus data
P a g e | 171
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Ket: 9. 10. 11. 12. 13. NOMER UJIAN, CALON MAHASISWA; diinput COMBOBOX JURUSAN; isi dengan nama jurusan= AKUNTANSI, MANAJEMEN, KOMPUTER NILAI B.INGGRIS, MATEMATIKA, KOMPUTER; di input RATA RATA = (nilai b.inggris + matematikan + computer)/3 KETERANGAN= a. Jika RATARATA >70, maka KETERANGAN= LULUS b. Jika RATARATA 60 - 70, maka KETERANGAN= LULUS SYARAT c. Jika RATARATA >60 , maka KETERANGAN= TIDAK LULUS
Tombol: 3. 4. Tombol NEW; mengosonkan textbox dan combobox Tombol SAVE, FIND, DELETE; gunakan Store procedure untuk simpan,cari dan hapus data
P a g e | 172
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 173
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
REFERENSI
STORE PROCEDURE
P a g e | 174
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
OleDb
VB
Dim nwindConn As OleDbConnection = New OleDbConnection("Provider=SQLOLEDB;Data Source=localhost;Integrated Security=SSPI;" & _ "Initial Catalog=northwind") Dim salesCMD As OleDbCommand = New OleDbCommand("SalesByCategory", nwindConn) salesCMD.CommandType = CommandType.StoredProcedure Dim myParm As OleDbParameter = salesCMD.Parameters.Add("@CategoryName", OleDbType.VarChar, 15) myParm.Value = "Beverages" nwindConn.Open() Dim myReader As OleDbDataReader = salesCMD.ExecuteReader() Console.WriteLine("{0}, {1}", myReader.GetName(0), myReader.GetName(1)) Do While myReader.Read() Console.WriteLine("{0}, ${1}", myReader.GetString(0), myReader.GetDecimal(1)) Loop myReader.Close() nwindConn.Close()
Odbc
VB
Dim nwindConn As OdbcConnection = New OdbcConnection("Driver={SQL Server};Server=localhost;Trusted_Connection=yes;" & _ "Database=northwind") nwindConn.Open() Dim salesCMD As OdbcCommand = New OdbcCommand("{ CALL SalesByCategory(?) }", nwindConn) salesCMD.CommandType = CommandType.StoredProcedure Dim myParm As OdbcParameter = salesCMD.Parameters.Add("@CategoryName", OdbcType.VarChar, 15) myParm.Value = "Beverages" Dim myReader As OdbcDataReader = salesCMD.ExecuteReader() Console.WriteLine("{0}, {1}", myReader.GetName(0), myReader.GetName(1)) Do While myReader.Read() Console.WriteLine("{0}, ${1}", myReader.GetString(0), myReader.GetDecimal(1)) Loop
P a g e | 175
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
myReader.Close() nwindConn.Close()
A Parameter object can be created using the Parameter constructor, or by calling the Add method of the Parameters collection of a Command. Parameters.Add will take as input either constructor arguments or an existing Parameter object. When setting the Value of a Parameter to a null reference, use DBNull.Value. For parameters other than Input parameters, you must set the ParameterDirection property to specify whether the parameter type is InputOutput, Output, or ReturnValue. The following example shows the difference between creating Input, Output, and ReturnValue parameters.
SqlClient
VB
Dim sampleCMD As SqlCommand = New SqlCommand("SampleProc", nwindConn) sampleCMD.CommandType = CommandType.StoredProcedure Dim sampParm As SqlParameter = sampleCMD.Parameters.Add("RETURN_VALUE", SqlDbType.Int) sampParm.Direction = ParameterDirection.ReturnValue sampParm = sampleCMD.Parameters.Add("@InputParm", SqlDbType.NVarChar, 12) sampParm.Value = "Sample Value" sampParm = sampleCMD.Parameters.Add("@OutputParm", SqlDbType.NVarChar, 28) sampParm.Direction = ParameterDirection.Output nwindConn.Open() Dim sampReader As SqlDataReader = sampleCMD.ExecuteReader() Console.WriteLine("{0}, {1}", sampReader.GetName(0), sampReader.GetName(1)) Do While sampReader.Read() Console.WriteLine("{0}, {1}", sampReader.GetInt32(0), sampReader.GetString(1)) Loop sampReader.Close() nwindConn.Close() Console.WriteLine(" @OutputParm: {0}", sampleCMD.Parameters("@OutputParm").Value) Console.WriteLine("RETURN_VALUE: {0}", sampleCMD.Parameters("RETURN_VALUE").Value)
P a g e | 176
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
OleDb
VB
Dim sampleCMD As OleDbCommand = New OleDbCommand("SampleProc", nwindConn) sampleCMD.CommandType = CommandType.StoredProcedure Dim sampParm As OleDbParameter = sampleCMD.Parameters.Add("RETURN_VALUE", OleDbType.Integer) sampParm.Direction = ParameterDirection.ReturnValue sampParm = sampleCMD.Parameters.Add("@InputParm", OleDbType.VarChar, 12) sampParm.Value = "Sample Value" sampParm = sampleCMD.Parameters.Add("@OutputParm", OleDbType.VarChar, 28) sampParm.Direction = ParameterDirection.Output nwindConn.Open() Dim sampReader As OleDbDataReader = sampleCMD.ExecuteReader() Console.WriteLine("{0}, {1}", sampReader.GetName(0), sampReader.GetName(1)) Do While sampReader.Read() Console.WriteLine("{0}, {1}", sampReader.GetInt32(0), sampReader.GetString(1)) Loop sampReader.Close() nwindConn.Close() Console.WriteLine(" @OutputParm: {0}", sampleCMD.Parameters("@OutputParm").Value) Console.WriteLine("RETURN_VALUE: {0}", sampleCMD.Parameters("RETURN_VALUE").Value)
Odbc
VB
Dim sampleCMD As OdbcCommand = New OdbcCommand("{ ? = CALL SampleProc(?, ?) }", nwindConn) sampleCMD.CommandType = CommandType.StoredProcedure Dim sampParm As OdbcParameter = sampleCMD.Parameters.Add("RETURN_VALUE", OdbcType.Int) sampParm.Direction = ParameterDirection.ReturnValue sampParm = sampleCMD.Parameters.Add("@InputParm", OdbcType.VarChar, 12) sampParm.Value = "Sample Value" sampParm = sampleCMD.Parameters.Add("@OutputParm", OdbcType.VarChar, 28) sampParm.Direction = ParameterDirection.Output nwindConn.Open()
P a g e | 177
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Dim sampReader As OdbcDataReader = sampleCMD.ExecuteReader() Console.WriteLine("{0}, {1}", sampReader.GetName(0), sampReader.GetName(1)) Do While sampReader.Read() Console.WriteLine("{0}, {1}", sampReader.GetInt32(0), sampReader.GetString(1)) Loop sampReader.Close() nwindConn.Close() Console.WriteLine(" @OutputParm: {0}", sampleCMD.Parameters("@OutputParm").Value) Console.WriteLine("RETURN_VALUE: {0}", sampleCMD.Parameters("RETURN_VALUE").Value)
As a result, the order in which Parameter objects are added to the Parameters collection must directly correspond to the position of the question mark placeholder for the parameter.
P a g e | 178
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
END
P a g e | 179
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 180
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat
LOGIN
P a g e | 181 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
LOGIN,
UserPassword
Biasanya system mempunyai HAK HAK terhadap seorang user. Dalam latihan ini kita mencoba membeda USER menjadi 2 : Jenis USer ADMIN USER :semua menu muncul :menu DATA MASTER, menu REPORT - TIDAK MUNCUL (Visible=True)
>> LEVEL_USER isi dengan ADMIN / USER >> isi data user password
P a g e | 182
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 183
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE di MODULE
MODULE1
Gunakan MODUL sebelumnya jika sudah ada berarti tidak perlu buat modul kembali yahhhhhh
CODE di FORM
Code : FORM LOAD
Me.TextBox1.Text = "" Me.TextBox2.Text = "" Me.TextBox1.Focus()
Code : TOMBOL OK
If Me.TextBox1.Text = "" Or Me.TextBox2.Text = "" Then MSGBOX("User dan Password harus di isi..") Exit Sub End If
P a g e | 184
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Call BUKA_db() Dim AA As String = "" AA = " SELECT * FROM USER_PASSWORD " & _ " WHERE NAMA_USER='" & Trim(Me.TextBox1.Text) & "' " & _ " AND PASSWORD='" & Trim(Me.TextBox2.Text) & "' " CMD = New Odbc.OdbcCommand(AA, CONN) RS = CMD.ExecuteReader() If Not RS.Read Then MsgBox("USER PASSWORD SALAH", MsgBoxStyle.Information) RS.Close() CMD.Dispose() Exit Sub Else Msgbox (OK) RS.Close() CMD.Dispose() Me.Hide()
Me.hide form login di matikan (di sembunyikan) Form2.show munculkan form menu utama
Form2.Show()
End If
P a g e | 185
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
s e l i n g a n
FORM LOGIN CARA HEMAT+CEPAT Tanpa DataBase:hanya me-ngeCEK input TEXT1 & TEXT2 saja
CODE di FORM
Code : FORM LOAD
Me.TextBox1.Text = "" Me.TextBox2.Text = "" Me.TextBox1.Focus()
Code : TOMBOL OK
If Me.TextBox1.Text = "ADMIN" AND Me.TextBox2.Text = "ADMIN" Then MSGBOX ("OK") Me.Hide Form2.Show() Else MSGBOX ("USER PASSWORD SALAH") Exit Sub End If
jadi hanya mengecek TEXT1 dan TEXT2, apakah sama dengan user-password yang telah kita tentukan saja.. P a g e | 186 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
Keterangan:
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 187
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
STOK
(info saja)
P a g e | 188 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
membuat
INPUT
Pembelian sparepart
.barang masuk.
(stok+)
P a g e | 189 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
TEORI DASAR
STOK
Teori dasar stok :
+ (bertambah)
Table barang UPDATE stok barang (berkurang) Table sparepart_masuk HAPUS data transaksi
(berkurang)
Table barang UPDATE stok barang + (bertambah) Table PENJUALAN HAPUS data transaksi
P a g e | 190
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
NAMA BARANG, STOK muncul otomatis jika COMBO Kode Barang di KLIK
P a g e | 191
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
NGOBROL-NGOBROL
Form dg 2 table
Untuk form barang masuk menggunakan 2 table, yaitu : 1. Table BARANG_JASA 2. Table SPAREPART_MASUK Maka di form kita juga menggunakan 2 RECORDSET dan di difinisikan di MODULE. Yaitu
P a g e | 192
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di MODULE:
Code di MODULE Ket
TRUE=simpan sb input FALSE=simpan sb edit RS bisa banyak, disesuaikan dengan kebutuhan dan jumlah TABLE yg dibuka
recordset/Tablenya recordset/Tablenya
Exit Sub CEK: MsgBox(Err.Description, MsgBoxStyle.Information, "CONNECTION ERROR") End End Sub
P a g e | 193
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Public Sub KOSONG(ByVal obj As Object) procedure untuk mengosongkan TextBox For Each ctl As Control In obj.controls If TypeOf ctl Is TextBox Then ctl.Text = "" End If Next End Sub
P a g e | 194
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di
FORM
pembuatan
PROCEDURE
Procedure ini untuk Mengisi COMBO BARANG dengan KODE BARANG
Sub
ISI_COMBO_BARANG()
Call BUKA_DB() Dim AA As String = "" AA = " SELECT * FROM BARANG_JASA ORDER BY KODE_BARANG_JASA" CMD = New Odbc.OdbcCommand(AA, CONN) RS = CMD.ExecuteReader() '/ Combo di kosongkan doloooo Me.ComboBox1.Items.Clear() '/-----------------------------------------------------------------/ '/ Gunakan .Hasrows Untuk Mengecek Jumlah Data Yg Diambil '/ Biasanya Untuk Cek Apakah Table Ada Recordnya.. Cari Data '/-----------------------------------------------------------------/
P a g e | 195
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
If RS.HasRows Then '/-----------------------------------------------------------------/ '/ Untuk membaca/baca RECORD Gunakan RS.READ '/-----------------------------------------------------------------/ While RS.Read End While End If '/ Tutup table kembali RS.Close() CMD.Dispose() End Sub
Me.ComboBox1.Items.Add(RS("KODE_BARANG_JASA"))
Sub
MUNCULKAN_nama_barang()
'/ Menampilkan Nama Barang Ketika Combo Di Click / gunakan RS2, untuk menghindari bentrok nya data dg RS Call BUKA_DB() Dim AA As String = ""
AA = " SELECT * FROM BARANG_JASA WHERE KODE_BARANG_JASA='" & Me.ComboBox1.Text & "' "
RS2 = CMD.ExecuteReader()
P a g e | 196
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Read
Then
'/ Ambil field nya dan munculkan ke form Me.TextBox2.Text = RS2("NAMA_BARANG_JASA") Me.TextBox4.Text = RS2("STOK") Else Me.TextBox2.Text = "" Me.TextBox4.Text = "" MsgBox("NAMA BARANG TIDAK ADA", MsgBoxStyle.Information) End If '/ tutup kembali table RS2.Close() CMD.Dispose() End Sub Procedure Munculkan_nama_barang Menggunakan RS2 ini untuk menghindari bentrok nya data dengan yang ada di RS
P a g e | 197
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE di FORM
Code di:
FORM LOAD
Code di:
COMBOBOX1 SelectedIndexChanged
Call Munculkan_NAMA_BARANG()
CODE di TOMBOL
Code di:
TOMBOL EXIT
Me.Close()
Code di:
TOMBOL CANCEL
Code di:
TOMBOL NEW
modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Me.TextBox1.Focus()
Code di:
TOMBOL SAVE
'/=========================================/ '/ '/ SIMPAN DATA BARANG MASUK '/ ADA 2 PROSES : '/ (1). SIMPAN DATA TRANSAKSI KE TABLE SPAREPART_MASUK '/ (2). UPDATE STOK BARANG DI TABLE BARANG_JASA, STOK + '/ '/=========================================/ '/ Cek input angka If IsNumeric(Me.TextBox3.Text) = False Then MsgBox("ISI JUMLAH DENGAN ANGKA", MsgBoxStyle.Information) Exit Sub End If Call BUKA_DB() '/-----------------------------------------------------/ '/ 1.CEK PRIMARY KEY '/-----------------------------------------------------/ Dim AA As String = ""
AA = " SELECT * FROM SPAREPART_MASUK " & _ " WHERE NO_MASUK='" & Trim(Me.TextBox1.Text) & "' "
CMD = New Odbc.OdbcCommand(AA, CONN) RS = CMD.ExecuteReader()
P a g e | 199
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/ CEK apakah nomer sudah ada/ punya data baris (ROWS) If RS.HasRows Then
'/---------------------------------------------------------/ '/ NO.MASUK SUDAH ADA, PROSES DIBATALKAN '/---------------------------------------------------------/ MsgBox("NO.MASUK SUDAH ADA...", MsgBoxStyle.Information) RS.Close() CMD.Dispose() Exit Sub End If RS.Close() CMD.Dispose() 'yg ini tidak perlu di tulis, hanya catatan saya sahaja.. 'CONVERT(DATETIME, '2009-01-01 00:00:00', 102) '" CONVERT(DATETIME,'" & Me.DateTimePicker1.Value & "',102), " & _
'/ PROSES #1
'/=====================================/ '/ 1.SIMPAN TRANSAKSI NYA KE TABLE SPAREPART_MASUK '/=====================================/ Dim MANIS As String = ""
MANIS = " INSERT INTO SPAREPART_MASUK " & _ "(NO_MASUK,TGL,KODE_BARANG,NAMA_BARANG,JUMLAH)" & _ " VALUES " & _ " ('" & Me.TextBox1.Text & "', " & _ " '" & Me.DateTimePicker1.Value & "', " & _ " '" & Me.ComboBox1.Text & "', " & _ " '" & Me.TextBox2.Text & "', " & _ Me.TextBox3.Text & ")"
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CMD.Dispose()
'/ PROSES #2
'/=======================================/ '/ 2.UPDATE (+) STOK DI TABEL BARANG '/=======================================/ Dim KEREN As String = "" KEREN = " UPDATE BARANG_JASA " & _ " SET STOK=STOK
" WHERE KODE_BARANG_JASA='" & Trim(Me.ComboBox1.Text) & "' " CMD = New Odbc.OdbcCommand(KEREN, CONN) CMD.ExecuteNonQuery() CMD.Dispose() MsgBox("DATA TELAH DI SIMPAN,CEK STOK BARANG", MsgBoxStyle.Information)
P a g e | 201
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
(1) LATIHAN
Coba buat untuk FIND & DELETE TRANSAKSI BARANG MASUK.. ingat update stok
P a g e | 202
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 203
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 204
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 205
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 206
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 207
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Membuat Transaksi
1-Many
(Master Detail)
P a g e | 208 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SYSTEM BENGKEL
Database SQL Server
DATABASE TABLE : :
BENGKEL
1.PELANGGAN FIELD KODE_PELANGGAN NAMA_PELANGGAN 2.BARANG_JASA FIELD KODE_BARANG_JASA NAMA_BARANG_JASA KATEGORI HARGA STOK 3.SPAREPART_MASUK FIELD NO_MASUK TGL KODE_BARANG NAMA_BARANG JUMLAH 4.SERVICE FIELD NO_SERVICE TGL KODE_PELANGGAN SUBTOTAL_SERVICE DISCOUNT TOTAL_SERVICE 5.SERVICE_RINCIAN FIELD NO_SERVICE KODE_BARANG_JASA NAMA_BARANG_JASA HARGA JUMLAH SUBTOTAL NO_URUT
SIZE 10 50
ALLOWNULL V
KET PrimaryKey
SIZE 10 30 10
ALLOWNULL V V v
KET PrimaryKey
KET PrimaryKey
ALLOWNULL KET 10 V 10 V 30 V default V default V default V default PrimaryKey, Indentity=Yes, Indentity Increment=1
SIZE
P a g e | 209
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
NGOBROL-NGOBROL
Form transaksi service bengkel ini menggunakan 4 table, yaitu : 1. 2. 3. 4. Table PELANGGAN Table BARANG_JASA Table SERVICE Table SERVICE_RINCIAN sebagai HEADER (1 one) sebagai DETAIL NYA (Many)
Karena menggunakan >1 table maka, untuk keperluan dalam proses pembacaan data sebaiknya kita gunakan > 1 DATAREADER. Jadi difinisi datareader di MODULE menggunakan >1 datareader Potongan kode di module:
P a g e | 210
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Ini adalah
LISTVIEW
Info: UNTUK MEMPERSINGKAT KODE, MAKA: Disini hanya di ketik code-code pokoknya saja Transaksi tidak dengan CODE PROSES EDIT UPDATE SERVICE, setelah data selesai di input maka data di SIMPAN TRANSAKSI dan di PRINT BON SERVICE Code tidak mengatur tombol mana yang aktif, atau tombol mana saja yang tidak aktif
P a g e | 211
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
DESIGN REPORT
Ini adalah sebuah GROUP
KETERANGAN: Untuk setingan 1 many; yaitu 1 (One) nya untuk pengelompokan data / group nya berdasarkan NO_SERVICE,
P a g e | 212
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
RUNNING
P a g e | 213
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE DI MODUL
Code di:
MODULE
/koneksi ke db /perintah sql /buka table /buka table /buka table
RS banyak karena banyak table
Public CONN As New Odbc.OdbcConnection Public CMD As New Odbc.OdbcCommand Public RS As Odbc.OdbcDataReader Public RS2 As Odbc.OdbcDataReader Public RS3 As Odbc.OdbcDataReader
Sub BUKA_DB()
On Error GoTo CEK Dim AA As String AA = "Dsn=ODBC_BENGKEL;User ID=;PWD=;trusted_connection=Yes;" CONN = New Odbc.OdbcConnection(AA) /buka db CONN.Open() Exit Sub CEK:
MsgBox(Err.Description, MsgBoxStyle.Information, "CONNECTION ERROR")
P a g e | 214
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Sub NOMER_OTOMATIS()
'/----------------------------------------------/ '/ '/ INI UNTUK MEMBUAT No.URUT BARU '/ FORMAT NOMER ADALAH : THN/BLN/NOMER URUT '/ CONTOH NOMER : / / '/ 12 = TAHUN 1 DIGIT '/ 6 = BULAN '/ 0001 = NOMER URUT 4 DIGIT '/ NOMER MENJADI 1 LAGI SAAT TAHUN BARU '/ '/-----------------------------------------------/ Call BUKA_DB() '/---1.BUKA DATA PER TAHUN DAN NOMER DESC, TIAP TAHUN NOMER 1 LAGI Dim bb As String bb = " SELECT TOP 1 NO_SERVICE FROM SERVICE " & _ " WHERE Year(TGL) =" & Year(Now) & _ " ORDER BY NO_SERVICE DESC"
P a g e | 215 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
12/6/0001
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CMD = New Odbc.OdbcCommand(bb, CONN) RS = CMD.ExecuteReader() '/---2.AMBIL NOMER AKHIR Dim NOMER_akhir As String = "" If RS.Read Then NOMER_akhir = RS("NO_SERVICE") End If RS.Close() CMD.Dispose() '/---3.AMBIL 4 DIGIT DIBELAKANG NOMER; 0001 Dim NOMER As String = "" NOMER = Microsoft.VisualBasic.Right(NOMER_akhir, 4) '/---4.KONVERSI STRING KE NUMERIC, JUMLAHKAH NOMER +1 Dim NOMER_BARU As String NOMER_BARU = Val(NOMER) + 1 '/---5.BUAT NOMER BARU, GABUNGKAN Dim BULAN As String = Format(Now, "MM") Dim TAHUN As String = Format(Now, "yy")
NOMER OTOMATIS
'/Month(Now) '/Year(Now)
'/--- GABUNGKAN NOMER DENGAN NOL, DAN AMBIL NOMER NYA Dim NOMER_NYA As String = "" NOMER_NYA = Microsoft.VisualBasic.Right("0000" & NOMER_BARU, 4) '/---6.TAMPILKAN NOMER BARU Me.TextBox1.Text = TAHUN & "/" & BULAN & "/" & NOMER_NYA End Sub
P a g e | 216
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Sub COMBO_PELANGGAN()
Call BUKA_DB() Dim ABC As String = "" ABC = " SELECT * FROM PELANGGAN ORDER BY KODE_PELANGGAN" CMD = New Odbc.OdbcCommand(ABC, CONN) Dim rs As Odbc.OdbcDataReader rs = CMD.ExecuteReader() Me.ComboBox1.Items.Clear() /buka table sql /ambil data ke RS /kosongkan combo dulu
If rs.HasRows Then /data mau di baca While rs.Read /mulai looping Me.ComboBox1.Items.Add(rs("KODE_PELANGGAN")) /masukan ke combo End While Else MsgBox("DATA PELANGGAN TIDAK ADA..", MsgBoxStyle.Information) End If rs.Close() /tutup table CMD.Dispose() /hapus dari memory End Sub
P a g e | 217
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Sub CARI_DATA_PELANGGAN()
Call BUKA_DB() Dim BB As String = "" / buka table dengan WHERE untuk seleksi data yg dicari BB = " SELECT * FROM PELANGGAN WHERE KODE_PELANGGAN='" & ComboBox1.Text & "' " CMD = New Odbc.OdbcCommand(BB, CONN) RS2 = CMD.ExecuteReader() /buka table
If RS2.Read Then /data ada tidak TextBox2.Text = RS2("NAMA_PELANGGAN") /ada, munculkan data Else MsgBox("DATA TIDAK ADA..", MsgBoxStyle.Information) End If RS2.Close() CMD.Dispose() End Sub
Sub CARI_DATA_BARANG()
Dim BB As String = "" / buka table dengan WHERE untuk seleksi data yg dicari BB = " SELECT * FROM BARANG_JASA WHERE KODE_BARANG_JASA='" & TextBox3.Text & "' "
P a g e | 218 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
/buka table
If RS.Read Then /baca data TextBox4.Text = RS("NAMA_BARANG_JASA") /munculkan nama ke textbox TextBox5.Text = RS("HARGA") /munculkan harga ke textbox TextBox6.Focus() '/taro kursor di jumlah Else MsgBox("DATA BARANG TIDAK ADA..", MsgBoxStyle.Information) TextBox4.Text = "" TextBox5.Text = "0" TextBox3.Focus() '/taor kursor di kode barang End If RS.Close() CMD.Dispose() End Sub
Sub HITUNG_GRAND_TOTAL()
'/BACA DATA SUBTOTAL DI LISTVIEW Dim xSUBTOTAL As Double = 0 Dim MM As Integer = 0 '/ GUNAKAN LOOPING UNTUK MEM-TOTAL SUBTOTAL DI LISTVIEW For MM = 0 To Me.ListView1.Items.Count - 1 '/ AMBIL DATA DI LISTVIEW, DAN JUMLAH KAN '/ SubItems (4) adalah kolom SUBTOTAL
P a g e | 219 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
xSUBTOTAL = xSUBTOTAL + Val(ListView1.Items(MM).SubItems(4).Text) Next Me.TextBox8.Text = xSUBTOTAL '/HITUNG GRAND TOTAL=SUBTOTAL - DISCOUNT If IsNumeric(TextBox8.Text) = False Then TextBox8.Text = "0" If IsNumeric(TextBox9.Text) = False Then TextBox9.Text = "0" Me.TextBox10.Text = TextBox8.Text - TextBox9.Text End Sub
Sub KOSONG_DEH()
TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Clear() Me.DateTimePicker1.Value = Now ComboBox1.Text = "" End Sub
P a g e | 220
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Sub LISTVIEW_SETTING()
With Me.ListView1 .Items.Clear() .FullRowSelect = True .GridLines = True .View = View.Details .AllowColumnReorder = True '/----- BIKIN KOLOM .Columns.Clear() .Columns.Add("KODE BARANG JASA", 150) .Columns.Add("NAMA BARANG JASA ", 200) .Columns.Add("HARGA", 100, HorizontalAlignment.Right) .Columns.Add("JUMLAH", 100, HorizontalAlignment.Right) .Columns.Add("SUBTOTAL", 100, HorizontalAlignment.Right) End With End Sub
Sub SIMPAN_DATA()
Call BUKA_DB()
P a g e | 221 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/------------------------------------------------------------------------------------------------------/
CMD = New Odbc.OdbcCommand(AA, CONN) CMD.ExecuteNonQuery() CMD.Dispose() '/-------------------------------------------------------------------------------------------------/ '/ 2. '/ SIMPAN DATA BARANG DI TABLE: SERVICE_RINCIAN '/ GUNAKAN LOOPING UNTUK MEMBACA DI LISTVIEW '/-------------------------------------------------------------------------------------------------/ Dim xKODE As String = "" Dim xNAMA As String = "" Dim xHARGA As Double = 0 Dim xJUMLAH As Double = 0 Dim xSUBTOTAL As Double = 0 Dim BB As Integer = 0 Dim MM As Integer = 0
P a g e | 222
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
For MM = 0 To Me.ListView1.Items.Count - 1
'/------------------------------------------------------/ '/ 3. AMBIL DATA DI LISTVIEW '/------------------------------------------------------/ xKODE = Me.ListView1.Items(MM).Text xNAMA = ListView1.Items(MM).SubItems(1).Text xHARGA = ListView1.Items(MM).SubItems(2).Text xJUMLAH = ListView1.Items(MM).SubItems(3).Text xSUBTOTAL = ListView1.Items(MM).SubItems(4).Text
'/------------------------------------------------------/ '/ 4. '/ SIMPAN KE TABLE: SERVICE_RINCIAN '/------------------------------------------------------/ Dim KK As String = "" KK = " INSERT INTO SERVICE_RINCIAN " & _
"(NO_SERVICE,KODE_BARANG_JASA,NAMA_BARANG_JASA,HARGA,JUMLAH,SUBTOTAL)" & _
" VALUES " & _ " ('" & TextBox1.Text & "' " & _ " ,'" & xKODE & "' " & _ " ,'" & xNAMA & "' " & _ " ,'" & xHARGA & "' " & _ " ,'" & xJUMLAH & "' " & _ " ,'" & xSUBTOTAL & "') " CMD = New Odbc.OdbcCommand(KK, CONN) CMD.ExecuteNonQuery() CMD.Dispose()
P a g e | 223
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
'/-----------------------------------------------------------------------------------------/ '/ 5. '/ KODE TAMBAHAN JIKA MENGGUNAKAN APLIKASI '/ UPDATE STOK BARANG; STOK BARANG DIKURANGI '/-----------------------------------------------------------------------------------------/ Dim UU As String UU = " UPDATE BARANG_JASA SET " & _ " STOK=STOK - " & xJUMLAH & _ " WHERE KODE_BARANG_JASA='" & xKODE & "' " CMD = New Odbc.OdbcCommand(UU, CONN) CMD.ExecuteNonQuery() CMD.Dispose()
STOK
Next
MsgBox("DATA TELAH DI SIMPAN", MsgBoxStyle.Information) End Sub
P a g e | 224
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE DI TOMBOL
Code di : TOMBOL INPUT
/ kosongkan textbox Call KOSONG_DEH() Call LISTVIEW_SETTING() / bikin nomer otomatis Call NOMER_OTOMATIS()
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
RS.Close() CMD.Dispose() Exit Sub End If CMD.Dispose() RS.Close() '/ PANGGIL PROCEDIRE SIMPAN DATA Call simpan_data()
With FF.CrystalReportViewer1 .DisplayGroupTree = False .ReportSource = Laporan .Refresh() End With FF.WindowState = FormWindowState.Maximized FF.ShowDialog()
P a g e | 226
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Else MsgBox("NO PENJUALAN TIDAK ADA", MsgBoxStyle.Information) RS.Close() CMD.Dispose() Exit Sub End If '/----------------------------------------------------------------------------------------------------------/ '/ 5. '/ BACA DATA BARANG DI TABLE: SERVICE_RINCIAN '/-----------------------------------------------------------------------------------------------------------/ Dim BB As String = "" BB = " SELECT * FROM SERVICE_RINCIAN " & _ " WHERE NO_SERVICE='" & Trim(cari) & "' " CMD = New Odbc.OdbcCommand(BB, CONN) RS = CMD.ExecuteReader() If RS.Read Then Dim lv As ListViewItem While RS.Read '/ 6-----. MASUKAN DATA KE LISTVIEW -----/ lv = Me.ListView1.Items.Add(RS("KODE_BARANG_JASA")) '/KODE lv.SubItems.Add(RS("NAMA_BARANG_JASA")) '/NAMA lv.SubItems.Add(RS("HARGA")) '/HARGA lv.SubItems.Add(RS("JUMLAH")) '/JUMLAH lv.SubItems.Add(RS("SUBTOTAL")) '/SUBTOTAL End While End If RS.Close() CMD.Dispose()
P a g e | 228
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 229
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 230
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
TOMBOL UPDATE (EDIT): Untuk rubah data barang pada posisi barang yg di KLIK
P a g e | 231
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Form_lookup.ShowFOCUS()
P a g e | 233
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 234
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
SELESAI.
P a g e | 235 modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 236
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
(Tambahan)
P a g e | 237
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE DI FORM
PROCEDURE
Procedure untuk menampilkan data ke listview Sub
TABLE_to_LISTVIEW()
'/----------------------------------------------------------------------/ '/ TAMPILKAN DATA BARANG KE LISTVIEW '/----------------------------------------------------------------------/ Call BUKA_DB() Dim AA As String = "" AA = " SELECT * FROM BARANG_JASA ORDER BY KODE_BARANG_JASA" CMD = New Odbc.OdbcCommand(AA, CONN) RS = CMD.ExecuteReader() With Me.ListView1 .Items.Clear() .FullRowSelect = True .GridLines = True .View = View.Details .AllowColumnReorder = True '/----- BIKIN KOLOM --------/ .Columns.Clear() .Columns.Add("KODE BARANG JASA", 150) .Columns.Add("NAMA BARANG JASA", 150)
P a g e | 238
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
.Columns.Add("HARGA", 85) .Columns.Add("STOK", 85) .Columns.Add("KATEGORI", 85) End With '/--------------------------------------/ '/ BACA DATA BARANG '/--------------------------------------/ If RS.HasRows Then Dim lv As ListViewItem While RS.Read '/ baca datanya lv = Me.ListView1.Items.Add(RS("KODE_BARANG_JASA")) '/ masukan ke LV lv.SubItems.Add(RS("NAMA_BARANG_JASA")) lv.SubItems.Add(RS("HARGA")) lv.SubItems.Add(RS("STOK")) lv.SubItems.Add(RS("KATEGORI")) End While End If RS.Close() CMD.Dispose() End Sub '/ tutup table '/ apakah datanya ada
Procedure untuk mengambil data di listview dan di TAMPILKAN ke form transaksi Sub
AMBIL_DATA_BARANG()
modul belajar sendiri VBNet oleh Indra Afgan update 25-Maret-2012
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
On Error Resume Next '/ MASUKAN DATA BARANG KE FROM TRANSAKSI '/ Form_transaksi adalah nama form 1-many nya, RUBAHLAH nama ini '/ sesuai dengan nama form masing-masing With Form_TRANSAKSI .TextBox3.Text = Me.ListView1.FocusedItem.Text .TextBox4.Text = Me.ListView1.FocusedItem.SubItems(1).Text .TextBox5.Text = Me.ListView1.FocusedItem.SubItems(2).Text End With End Sub
CODE DI : TOMBOL
Code di : TOMBOL REFRESH
Call TABLE_to_LISTVIEW()
P a g e | 240
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
CODE DI : FORM
Code di : FORM - LOAD
Call TABLE_to_LISTVIEW()
Enter
P a g e | 241
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
REPORT
P a g e | 242
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Code di :
FORM - RESIZE
P a g e | 243
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 244
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Design Report
P a g e | 245
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
>> klik OK
>> klik Create New Connection + ODBC + Make New Connection >> klik Next
P a g e | 246
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 247
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
>> Nama table muncul, AMBIL table2 untuk report, >>Klik Next
P a g e | 248
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Service.Subtotal_service Service.Discount
>> Next
P a g e | 249
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
FINISH
P a g e | 250
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Bikin GROUP
Pilih
SERVICE. NO_SERVICE
P a g e | 251
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 252
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 253
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 254
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 255
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
MEMBUAT LAPORAN
TRANSAKSI harian
(menggunakan 2 tanggal range- ) Format report menggunakan Laporan bon
CODE: Code:
Laporan.RecordSelectionFormula =
"{SERVICE.NO_TGL} >=CDATE (" & DateTimePicker1.Text & ") AND {SERVICE.TGL} <= CDATE ( & DateTimePicker2.Text & ") With AA.CrystalReportViewer1 .DisplayGroupTree = False .ReportSource = Laporan .Refresh() End With AA.Show()
P a g e | 256
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Laporan.RecordSelectionFormula = "{SERVICE.TGL} >=CDATE (" & DateTimePicker1.Text & ") AND {SERVICE.TGL} <=CDATE ( & DateTimePicker2.Text & ")
P a g e | 257
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 258
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Alhamdulillah
Selesai Modul ini untuk programmer pemula yang sedang belajar dengan gigih dan kerja kerasssssssssssssss Salam dari ane
P a g e | 259
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 260
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 261
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
P a g e | 262
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
PADA AKHIRNYA..
Dan.... pada akhirnya jumlah perempuan semakin banyak & banyak Dan Pada akhirnya Jumlah laki-laki semakin sedikit & sedikit.. Dan Pada akhirnya hukum POLIGAMI akan diterima oleh masyarakat umum (Muslim & Non Muslim) dengan sendirinya..
P a g e | 263
| IndraES | 0857.73.59.59.69 | Imut | Manis | Keren | Ganteng | Penyayang | Sabar |Cool | Lucu | Lincah |
Jangan lupa untuk MEMBACA AL-QURAN setiap hari, 1 ayat saja mudahkan
P a g e | 264