I have a database in ms access with table name `regn`. I want to populate the field name `nocount` using command text and executescaler. Here is my code:

```
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
dim i as integer
    If cn.State = ConnectionState.Open Then
        cn.Close()
    End If
    cn.Open()

    cmd.CommandText = "select nocount from regn where pname='" & PNAMETextBox.Text & "' And fname='" & FNAMETextBox.Text & "' And dob='" & DOBDateTimePicker.Text & "' "
    i = cmd.ExecuteScalar

    cn.Close()

```