I would like to develop a custom module that displays data from the currently logged in users database.
Each of my users has a “private” SQL database e.g.
User |
Database |
User1 |
C29001 |
User2 |
C29002 |
User3 |
C29003 |
When User1 logs in, the module should show data in dbo.C29001.tablename
When User2 logs in, the module should show data in dbo.C29002.tablename
And so on
All my stored procedures are added to all user databases, so a can get data by using dbo.C29001.StoredProcedureName or dbo.C29002.StoredProcedureName and so on.
The problem is to figure out where in the code I can specify individual database names based on the logged in user.
NB! The database user (dbo) is the same for all databases, only database name differs!
In previous I would just replace the database name in the connection string, runtime, but I am not sure what to do In DotNetNuke multi tier.
Any guidelines will be appreciated
Regards
Claus