Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
ASP.NET (vb) Check Database for User ID
Old 11-25-2009, 09:12 AM ASP.NET (vb) Check Database for User ID
mb2000inc's Avatar
Extreme Talker

Posts: 150
Name: Mark
Location: Ohio
Trades: 0
What I have, is a single table containing a user ID. When a user logs in to a site (possible new user), I want to check the table to see if they exist or not... if the record exists, then continue with the login process.
If not, then redirect the user to a sign up page.

I have the database connection established...
Code:

Dim mMyConnectionString AsNew SqlConnection(ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString)
Dim SQLCommand AsNew SqlCommand("SELECT USERID FROM([DatabaseName].[dbo].[Store]", mMyConnectionString)
Dim reader As SqlDataReader = SQLCommand.ExecuteReader()
But for some reason, my brain is not functioning this morning... and can't get the syntax right for this...

If reader finds the record, then do the function, Else, redirect to sign-up page.

HELP!

Thanks,
-mb
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
 
Register now for full access!
Old 11-26-2009, 01:24 AM Re: ASP.NET (vb) Check Database for User ID
alex021's Avatar
Super Talker

Posts: 118
Name: Alex
Trades: 0
I think you missing "where" part in you quiery will becouse in a current state it will return all userids in database
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
---
Please login or register to view this content. Registration is FREE
---
Please login or register to view this content. Registration is FREE
alex021 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to ASP.NET (vb) Check Database for User ID
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10664 seconds with 12 queries