Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2005, 12:49 AM
Authorized User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to NitinJoshi
Default Selecting Data..

I'm having a problem...i want to Authenticate a user...if his name is in database..how can i validate it...?which type of query i should write....?so that i will find his name in database...

Thanx For U R Reply!!

-Nitin
 
Old January 17th, 2005, 02:21 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You can write an query like
Select name from Table where UPPER(name) = Upper(nametotest)
If the name is NULL ,username is not found in database.

 
Old January 17th, 2005, 07:23 AM
Authorized User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to NitinJoshi
Default

Thanx!!!
I Guess U Only Read My Questions...Keep it up!!!!
DOnt Mind...!!
 
Old January 18th, 2005, 02:59 AM
Authorized User
 
Join Date: Dec 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kvanchi
Default

method 1:
first make conenction with databse
then use the command like
select * from table name where username = "textboxvalue"
check if it return any row by properties like
dr.Hasrows
it will contain row if the username is in database
 following is the code to authenticate username and paswd

Command.Connection = Connection
Connection.Open()
command.CommandText = "select * from login where username='" + txtusername.Text + "' and passwd='" + txtpassword.Text + "'"
dr = Command.ExecuteReader
        dr.Read()
      If dr.HasRows = True Then
"allow inside"
else
"display error"
end if


method 2:
first create a connection with the database
then use the statement like
select username from table name
save the username return from the table in a array format
then match it with the user name which the user type in the text box
if matches allow inside
else
display error msg


my email id is
vanchialai@yahoo.co.in






Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting Data from a table nkrust Javascript 7 January 11th, 2007 05:44 AM
selecting data in datetime intervals Phathu SQL Server 2005 1 August 29th, 2006 03:53 PM
Selecting Data from External Documents tslag XSLT 2 July 24th, 2006 10:35 AM
Problem with selecting data between two dates serf SQL Language 1 January 18th, 2006 01:16 PM
Selecting data from lookup fields hashtlishnii Access 3 September 25th, 2003 11:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.