Kumpulan Program

.netKumpulan Program penting Visual Basic .net

  1. 1. Menutup semua Form yang sedang terbuka

For i As Integer = My.Application.OpenForms.Count – 1 To 0 Step -1

If My.Application.OpenForms.Item(i) IsNot Me Then

My.Application.OpenForms.Item(i).Close()

End If

Next i

  1. 2. Menghapus row pada gridview
3.  Private Sub btnDelete_Click(ByVal sender As System.Object, _
4.      ByVal e As System.EventArgs) Handles btnDelete.Click
5.      If Not DataGridView1.CurrentRow.IsNewRow Then
6.          DataGridView1.Rows.Remove(DataGridView1.CurrentRow)
7.      End If
8.  End Sub
3. menambahkan nilai NULL ke database
 

If [String].IsNullOrEmpty(Textbox9.Text) = True Then

To insert a null value into the database, you must insert DBNull.Value.

This entry was posted in Kumpulan Program Penting. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Comments links could be nofollow free.