Last post Apr 26, 2011 04:23 AM by KumarHarsh
Apr 23, 2011 11:54 AM|samdedwards|LINK
I am using visual web developer 2010 with an access database and VB for the code behind. I have connected to the database and managed to create log-in, new user and admin functionality. I'm also using session to store both the users Username and UserID
so I know who is logged on.
This all worked fine until I started moving my pages into folders to make things neater. I also accidently deleted a folder and recovered it from the trash. Don't know if either of these events are relevant though. Now when I try and log on as a normal
user (everyone apart from admin) I get the error shown below. I have used exactly the same code for admin - but just specified that thier username must be admin and this seems to work fine.
Server Error in '/FinalWebsite2' Application.
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A field or property with the name 'UserID' was not found on the selected data source.
Any help would be appreciated! Please let me know if you need more information.
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Apr 23, 2011 04:23 PM|Mikesdotnetting|LINK
Maybe this provides an answer:
Apr 25, 2011 09:25 PM|Decker Dong - MSFT|LINK
How did you write your SQl select statement?
You must write it like "select userId,username,…… from xxx" and do ExecuteReader();
And then please confirm that your database really has contents.
Apr 26, 2011 04:23 AM|KumarHarsh|LINK
i) After moving pages to folder.Verify Database path.
Is it connecting well ?Test this.
ii)Did You Rebulid your project ?Any Error ?
iii) Verify table and its data in database ?