hi there,
my login was working fine with only using the 2 fileds user name and password

my login page uses my companydb.aspx code file to process the logins

basically i want to upgrade the login if you like
before it was
username password correct then come on in
if not correct stay out

now i want

if username password and comp_enabled = 1
then come on in

CompanyDB code
VB Code:
  1. Public Shared Function ValidateUser(ByVal UserName As String, ByVal Password As String, [COLOR=RoyalBlue]ByVal enabled As String[/COLOR]) _
  2.             As Boolean
  3.  
  4.         Dim sSelect As String
  5.         sSelect = "SELECT COUNT(*) FROM tb_comp_detail " _
  6.                 & "WHERE c_companycode = '" & UserName _
  7.                 & "' AND c_password = '" & Password & "'" _
  8.                 [COLOR=RoyalBlue]& "' AND c_comp_enabled = '" & enabled & "'"[/COLOR]
  9.  
  10.         Dim cmdSelect As New SqlCommand(sSelect, Connection)
  11.         Dim iCount As Integer
  12.         cmdSelect.Connection.Open()
  13.         iCount = cmdSelect.ExecuteScalar()
  14.         cmdSelect.Connection.Close()

my login page

VB Code:
  1. Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
  2.      
  3.         If companyDB.ValidateUser(txtUsername.Text, txtPassword.Text, [COLOR=RoyalBlue]lblOn.Text[/COLOR]) Then
  4.  
  5.             FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, chkAutomatic.Checked)
  6.         Else



changes i made above are in blue

the lblon is just a label text 1 in it

the error i get is incorrect syntax near 1