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

Am new to windows 7 phone apps and wants to get more involved with app and the cloud, as a student am making an app which can authenticate user's login password from a windows Azure Sql database.

Will someone please advise me what am doing wrong.

Am using c# as language and the testing is being done on a windows 7 emulator.

1. I can add users to the sql database but cannot login with the existing or created users details.



Below are the debug errors

System.Data.EntitySqlException was unhandled by user code

Message=The EntitySet 'User' is not defined in the EntityContainer 'HighMilesEntities'. Near simple identifier, line 1, column 51.


My service code as below:

C#
public string LoginUser(string userName, string password)
{
string query = @"SELECT value User.FullName FROM HighMilesEntities.User AS User WHERE User.UserName = @username AND User.Password = @password";
ObjectParameter[] parameters = new ObjectParameter[2];
parameters[0] = new ObjectParameter("UserName", userName);
parameters[1] = new ObjectParameter("Password", password);
 
using (var context = new HighMilesEntities())
{
ObjectQuery results = context.CreateQuery(query, parameters);
 
foreach (string result in results.Where(result => result != null))
{
return result;
}
}
return null; ;


Thanks in advance
Posted
Updated 30-Nov-11 14:33pm
v2

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