-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vipin4dotnet
Message 1 in Discussion
Hello EveryOne,
I have a database = Login
and it has a table = Users Having Fields-> UserID
|UserName | Password I am submitting the UserName and Password
by a submit button and Searching the (UserName+
Password).
If (Uname+Pwd) pair does'nt exis.I wanna flag
an error(Invalid uname OR Pwd)
I am Getting the Error:- Must declare the variable '@uname'.
My Script is as Follows:-
------------------------------------------------------------------------
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
dim strcon as string = "server=localhost;database=login;user id=sa;password=;"
dim strsql as string = "select username,password from users where & _
"username = @uname and password = @pwd "
Dim con as new sqlConnection(strcon)
Dim cmd As new sqlcommand(strsql,con)
dim dap as new sqldataadapter(strsql,con)
dim ds as new dataset()
cmd.parameters.add("@uname",sqldbtype.varchar,100)
cmd.parameters.add("@pwd",sqldbtype.varchar,100)
cmd.parameters("@uname").value = txtusername.text
cmd.parameters("@pwd").value = txtpassword.text
con.open()
dap.fill(ds,"users")
con.close()
dg.datasource = ds.tables("users")
dg.databind()
if ds.tables("users").rows.count= 0 then 'Please Note
response.write("UserName Or Password Does'nt Exist")
end if
end sub </SCRIPT>
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]