Private Sub recruit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles recruit.Click
    Dim query3 As String
    Dim n As Integer
    Dim query2 As String = "select max(stag) from agent"
    con.ConnectionString = ("Data Source=DESKTOP-CTN5IJ3\SQLEXPRESS;Integrated Security=True")
    Dim autono As New SqlCommand(query2, con)
    con.Open()
    If IsDBNull(autono.ExecuteScalar) Then
        n = 7
    Else
        n = autono.ExecuteScalar + 5
    End If
    con.Close()
    query3 = "insert into agent values(" + n + ",'" + ncrypt(txtssn.Text) + "','" + ncrypt(txtname.Text) + "','" + ncrypt(txtadd.Text) + "',0,0,'newbpwd')"
    Dim save As New SqlCommand(query3, con)
    con.Open()
    save.ExecuteNonQuery()
    con.Close()
End Sub
//query3 = "insert into agent values(" + n + ",'" + ncrypt(txtssn.Text) + "','" + ncrypt(txtname.Text) + "','" + ncrypt(txtadd.Text) + "',0,0,'newbpwd')" this is wher the problem is said to be
 
     
     
    