Hello, Could someone help me to resolve the problem in my code. I'm currently developing a application and the edit function of the system has some flaws in terms of the syntax. This system is developed using VB.Net.
Private Sub cmdEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEdit.Click
If Val(gridAdmin.Text) > 0 Then
If MsgBox("Edit this Administrator Details?", vbExclamation + vbYesNo, "Edit Administrator Details") = vbYes Then
SQL = "select * from admin_table where admin_ID = '" & gridAdmin.Text & "' "
rsSQL.Open(SQL, cs, adOpenKeyset, adLockOptimistic, adCmdText)
Call drawerOpen()
Call cboOption()
detailbox.Visible = True
cmdUpdate.Visible = True
cmdSave.Visible = False
txtName.ReadOnly = True
txtUsername.ReadOnly = True
rs.Read()
txtID.Text = rs("admin_ID")
txtName.Text = rs("admin_Name")
txtUsername.Text = rs("admin_Username")
txtPassword.Text = rs("admin_Password")
cboDesignation.Text = rs("admin_Designation")
End If
Else
dummy = MsgBox("No Administrator Details found!", vbCritical, "Error")
End If
rs.Close()
Conn.Close()
End Sub
The errors are :-
Name 'cs' is not declared
Name 'adOpenKeyset' is not declared
Name 'adLockOptimistic' is not declared
Name 'adCmdText' is not declared
Could someone explain me how to declare these syntax. Thank you