Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear,

I want to use linq to sql class and with the help of this class I want to make a login page. when I wite following code..

C#
DataClassesDataContext db = new DataClassesDataContext();
        var q1 = from log in db.logins
                 where log.userid == Login1.UserName && log.password == Login1.Password
                 select log;
        if (q1 != null)
        {
            Server.Transfer("AdminPannel.aspx");
        }


Above bold part of the code give error that log does not contain a userid and password defination. plz Please help me
Posted
Updated 9-Jul-12 0:03am
v2
Comments
pradiprenushe 9-Jul-12 5:22am    
Check 'logins' table column names.
Shahin Khorshidnia 9-Jul-12 6:05am    
And Also maybe the logins table has the columns but you need to check the cases. "userid" or "UserID" or "UserId" or ... ?!!
And please do not use sms words like "plz" instead of "please" here.
DaveAuld 9-Jul-12 6:56am    
I think you should explore the Membership providers for ASP.net, will make you life so much easier.

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