Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone!

I Am New In Razor MVC3 .i am trying to Make User login and Password Page.But i still face One Error and i still did not find any solution please Tell me Solution.
Error:
//Exception Details: System.Data.SqlServerCe.SqlCeException: There was an error //parsing the query. [ Token line number = 1,Token line offset = 82,Token in error //= ) ]

JavaScript
//Error in Query:
var Container=DB.QueryValue("SELECT Username,Password From LoginTable Where Username=@User AND Password=@Pass )");

I Also Try this one:
JavaScript
var Container=DB.QuerySingle("SELECT Username,Password From LoginTable Where Username=@User AND Password=@Pass )");

Please Tell me Error Solution.
Posted
Updated 23-Feb-15 7:37am
v3

1 solution

The error is that you have an extra parenthesis in the end of the statement. It should be
JavaScript
var Container=DB.QueryValue("SELECT Username,Password From LoginTable Where Username=@User AND Password=@Pass");

However, it looks like you're storing the password in plain text in the database. If that is true, do not do it. Instead use hashing properly. For example: Password Storage: How to do it.[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900