Hi friends here I am creating a simple Leave Management application for which User Management is required so for this I used ASP.Net configuration tool and created roles, users & permissions. After which a “ASPNETDB.mdf” database is generated under App_Code file. Next I created few .aspx pages like login.aspx, register.aspx, changepassword.aspx, displayinfo.aspx etc. and placed the required Login Controls in each page. In displayinfo.aspx (after the user login.aspx) I place a LoginName control which displays a message called “Welcome LoginNameControl(UserName)”. Next I created another database called LMS for maintaining Employees Leave Information which has tables like employee, dept, LeaveType, LeavePolicy etc. Now my question is when user login how to display the EmployeeID of Employee table in display.aspx along with the UserName which has no relation with “ASPNETDB.mdf” database. I guess this can be achieved with datarelation concept of dataset but I have no idea how to do it. Can anyone please provide me clear guidelines with proper code. I am not sure when to use ASP.Net Configuration tool whether its right choice in my case.
If both of the databases are on the same instance you could do something like this:
select database1.table1.column1 , database2.table2.column2
If not than you should have some DAL and write the code for it using the DAL's conventions
Now my question is when user login how to display the EmployeeID of Employee table in display.aspx along with the UserName which has no relation with “ASPNETDB.mdf” database.
You don't have to create a separate aspnetdb.mdf , what you can do is just simply run the asp_regsql command against your own database, then all the tables/views/stored procedures will b e created for you to use the build-in aspnet security/membership feature. Then you can easily create a foreign key relationship between different tables ( Your own table and aspnet table).
HTH.