Kumpulan Program penting Visual Basic .net
- 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
- 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.