Last post Apr 28, 2008 05:14 PM by pettrer
Oct 17, 2006 05:50 PM|pettrer|LINK
I'm trying to use the login features with an sql server 2000 db. So far it hasn't been a pleasant ride. Before I go on trying - does anyone know if they are compatible at all?
Oct 17, 2006 08:17 PM|albertpascual|LINK
Easy way: Click Website/ASP.NET Configuration. Will do the work for you
Oct 17, 2006 08:31 PM|pettrer|LINK
Yes, thanks, but what I'm asking is: Does Sql Server 200 work with WVD Express and asp.net 2.0 or do I need Sql Server 2005 for anything in specific?
Thanks for your reply,
Oct 17, 2006 09:03 PM|albertpascual|LINK
Oct 17, 2006 09:30 PM|pettrer|LINK
Minutes ago, I actually could see that for myself, for the very first time!!![:D]
I simply used the code from here
http://www.c-sharpcorner.com/UploadFile/sushmita_kumari/Logincontrol101312006002845AM/Logincontrol1.aspx?ArticleID=c33d0072-8f7c-4958-a7dc-ca1809737193 - which provides the code for a login control using a table of one's own. I made a VB version of it -
here it is in case someone wants it (passwords etc altered of course):
This is the complete aspx file:
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
This is the complete codebehind file:
Partial Class _Default
Protected Sub Login1_Authenticate(ByVal sender
ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs)
As Boolean =
Authenticated = SiteLevelCustomAuthenticationMethod(Login1.UserName, Login1.Password)
e.Authenticated = Authenticated
If (Authenticated =
Private Function SiteLevelCustomAuthenticationMethod(ByVal UserName
As Boolean =
As String =
"Data Source=sql.bjorn.se;Initial Catalog=db0544;Persist Security Info=True;User ID=du0457;Password=Khgfh5hgf"
Dim Connection As SqlConnection =
Dim strSQL As
String = "Select * From Main"
Dim command As SqlCommand =
New SqlCommand(strSQL, Connection)
Dim Dr As SqlDataReader
Dr = command.ExecuteReader
If ((UserName = Dr("user").ToString) _
And (Password = Dr("pwd").ToString))
boolReturnValue = True
I hope I brought something back to the community this way.
Now a question again - one's down, there are many to go, I guess; Login is fixed but the other login-related controls must have similar code, won't they? What about the code for, say, a CreateUserWizard control? If you can point me in the right direction,
I'd be grateful. Otherwise, thanks for your kind help so far.
From Sweden with love,
Oct 17, 2006 09:44 PM|albertpascual|LINK
You'll find them all on the toolbar under LOGIN CONTROLS, drag and drop. If Login is:
Oct 17, 2006 10:32 PM|pettrer|LINK
I seem to not make myself very clear tonight. :-)
What I meant was that I need to create the codebehind stuff coding for the rest of the login controls...
Oct 17, 2006 10:40 PM|pettrer|LINK
I'm working on the CreateUserWizard now and I think I got it working somewhat (will post it when it's ready for others) but I have a strange problem - I don't seem to be able to write to the db, and still get no error message! Ideas perhaps?
Here's the thread describing it: http://forums.asp.net/thread/1431692.aspx
Oct 17, 2006 11:38 PM|pettrer|LINK
You've got an interesting blog, by the way! I agree with you on Telerik's superiority, but as far as ajax goes, atlas does the job + it's free... Sorry to be OT.
Oct 18, 2006 05:15 AM|albertpascual|LINK
Actually Telerik wraps around Atlas enginee but with their controls, and those controls are very poweful, the combobox is the best control out there, still uses Atlas.
Atlas is great, but the controls are pretty poor, only use atlas as the UpdatePanel do not use extenders!
Sep 09, 2007 08:41 PM|jsouders|LINK
First, let me say that this posting saved me purchasing some rope and a sturdy chair. [;)] Now, my issue. After copying and pasting the code and getting everything to work, I realized that just the first user in the SQL table is allowed to authenticate.
No other person can. Any thoughts?
Sep 10, 2007 08:42 AM|pettrer|LINK
I'm so glad I stopped you from investing in some rope! ;-) Sturdy chairs, however, are nice to have.
I have no idea why you get this problem, but let me fill you in on what I did. After say 30 more hours of working with the controls I gave up and created them myself, using winforms. It's actually really easy, as long as you just want login functionality -
please tell me if you want to know how it's done.
However, I'd still be grateful if anyone could come up with a workable solution so that we could actually USE the login/create user wizard etc controls, together with an existing db. Conceptually I think it would be a piece of cake, but I have no idea how
to do the actual programming for it.
All the best,
Nov 14, 2007 10:17 AM|djfuller|LINK
This is great, but the sqldatareader doesn't go any further than the first row!!
Can you please tell me what I'm doing wrong:
Dr = command.ExecuteReader()
Dec 13, 2007 07:31 PM|delleung|LINK
I had the same problem running that code also, I found the problem though (at least I think).
the Dr.Close() and Return boolReturnValue should be outside the while.
If you think about it, it should make sense as the connection is either closed in the first iteration or a return value is returned automatically in the first iteration.
So try moving it out of the while loop and it should work.
Oh and also its missing the close for the sqlConnection, you might want to add that in also
Apr 23, 2008 02:30 PM|kpizzle01|LINK
This is a good post, but I found a problem with the following..
The logic is incorrect, and it renders a syntax error..
It should be this:
Apr 28, 2008 05:14 PM|pettrer|LINK
BTW - over 30,000 views now on this thread - must be some kind of record...