Need help with login

Results 1 to 2 of 2

Thread: Need help with login

  1. #1
    Join Date
    Dec 1969

    Default Need help with login

    Hi all, I am new in this thingy. Right now, I am tring to show a msg using the label. e.g. If the textbox is empty.<BR><BR>&#060;%@ Page Language="vb" %&#062;<BR>&#060;%@ Import Namespace="System.Data.OleDB" %&#062;<BR><BR>&#060;script runat="server"&#062;<BR><BR> &#039;check and validate username<BR> Sub Login_Click<BR><BR> &#039;Declare all variable needed<BR> Dim dbConn, Sql<BR> Dim StrUser, StrPass<BR> Dim BValid<BR><BR> &#039;Set variable to the values entered in the textboxes : (1) Username and (2) Password<BR> StrUser = username.Text<BR> StrPass = password.Text<BR><BR> &#039;Set the database connection<BR> dbconn = New OleDbConnection("Provider=Provider; Database=Database; User ID=ID; Password=Password")<BR><BR> &#039;Open the database connection<BR> dbconn.Open()<BR><BR> &#039;Create SQL Query Statement<BR> Sql = "SELECT * FROM EMPLOYEE WHERE USERID LIKE&#039;" & StrUser & "&#039;"<BR><BR> &#039;Set the validation variable to false<BR> BValid = False<BR><BR> &#039;Check the username and password<BR> If StrPass &#060;&#062; "" and StrUser &#060;&#062; "" Then<BR> BValid = True<BR> Else<BR> BValid = False<BR> lblloginstatus.Text = "Username is not valid"<BR> End If<BR> end sub<BR>&#060;/script&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Need help with login

    If you want to check whether the fields are empty before submitting them look up RequiredFieldValidator - a built in control which will do the validation for you.<BR><BR><BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts