Click here to Skip to main content
14,734,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to create a simple login form in without a database connection???

<script runat="server">
sub Page_Load
If txtuname.Text="xxx"  AND txtpass.Text="xxx" Then


Response.write("Invalid Username And Password")
End If
End sub

I am creating the form without database connection
and my code just look like this:

<script runat="server">
sub Page_Load

If (txtuname.Text = "xxx") AND (txtpass.Text = "xxx") Then
response.write("Welcome user")
response.write("Invalid username and password")
End IF
End sub

try this...:)

dim conn as new oledb.oledbconnection("your connection string")
dim sqlcmdtext as string = "select count(*) from yourusertable where usernamecolumn = @user and passwordcolumn = @pass"
dim cmd as new oledb.oledbcommand(sqlcmdtext, conn)
cmd.parameters.addwithvalue("@user", enteredusername)
cmd.parameters.addwithvalue("@pass", enteredpassword)
dim UserFoundCount as integer = convert.toint32(cmd.executescalar())
if UserFoundCount = 1 then
  'user exists
elseif UserFoundCount = 0 then
  'user not found
elseif UserFoundCount > 1 then
  'you have more than one of the same username and password in the table
end if

reference :[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900