473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Quest: Problem with Form Authentication w/ from MSDE SQL DB...

I am trying to work on adding Form Authentication to my ASP.NET app. I try
and gotten Form Authentication with the credentials in the Web.config
file... Now I am going by Jeff Prosise's book "Programming Microsoft .NET"
from Microsoft Press...

In the example there is a function CustomAuthenticate(string username,
string password)...

Here is a snip this code is in the try block...

dataConnection.Open(); //I have try this before with the SqlDataReader
obj and this works...

//Couldn't get StringBuilder to work but that another matter...
string SqlCommandText = "SELECT COUNT (*) FROM USERACCOUNTS WHERE Username =
\'";
SqlCommandText += username; //From CustomAuthenticate() prototype...
SqlCommandText += "\' AND CAST (RTRIM (Password) AS VARBINARY) = CAST (\'";
SqlCommandText += password; //From CustomAuthenticate() prototype...
SqlCommandText += "\' AS VARBINARY)";

SqlCommand dataCommand = new SqlCommand(SqlCommandText, dataConnection);

//Here is where the catch block is jumped more below...
int count = (int) dataCommand.ExecuteScalar();
return (count > 0);
}

In the catch block the debugger says System.Exception.Message = "The text,
ntext, and image data types cannot be compared or sorted, except when using
IS NULL or LIKE operator."...

What am I doing wrong here and why does it work in the book(though I didn't
try the CD example)...

Any help...


Nov 18 '05 #1
0 846

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Simon Chung-Jen Chuang | last post by:
Hello, I develop a web application with form authentication. When a user submit to login my web application, my codes in Login.aspx.cs have save the member info to Session. But when I try to get...
2
by: lewi | last post by:
I am trying to work on adding Form Authentication to my ASP.NET app. I try and gotten Form Authentication with the credentials in the Web.config file... Now I am going by Jeff Prosise's book...
1
by: slawek xxxxx | last post by:
Hello everyone, I have found a problem with form authentication method that I can't solve. The problem is: I want to use a form authentication in my application, so i set : <authentication...
2
by: lucd | last post by:
Hello, I am currently playing with form authentication & role based security on a web application. As seen in the starter kit Time tracker, I setup a custom identity class (CustomPrincipal)...
4
by: Mohan | last post by:
Using Form authetication to grant users access to a web application. If I go to the default webpage it shows the login screen but if enter a specific page in the application, it allows access...
0
by: Shailesh Gajare | last post by:
Hi All, I have a login page and a data page. For data page authentication is required. For few users authentication is being done by my server (.Net Server ) where form authentication is being...
2
by: ABC | last post by:
I have a default page which has two frame pages. On the plan, I expected it will forward to login page which show on one frame page only if the users don't login. In fact, both two frame pages...
1
by: graphicsxp | last post by:
Hi, I'm using FormsAuthentication.redirectFromLoginPage() in order to to user authentication. The problem is that I'm redirected to the last page visited before the session expired (or the...
2
by: nick | last post by:
I have an Asp.Net 2.0 application using form authentication. I want the html pages be protected by the authentication system too. The accessing of html files need to be authenticated in my local...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.