Click here to Skip to main content
15,881,709 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: about product license Pin
R. Giskard Reventlov8-Feb-10 4:37
R. Giskard Reventlov8-Feb-10 4:37 
Questionjavascript editor ? Pin
Subin Mavunkal7-Feb-10 4:54
Subin Mavunkal7-Feb-10 4:54 
AnswerRe: javascript editor ? Pin
Not Active7-Feb-10 6:14
mentorNot Active7-Feb-10 6:14 
Questionrights based database driven menu Pin
Spurple7-Feb-10 2:17
Spurple7-Feb-10 2:17 
AnswerRe: rights based database driven menu [modified] Pin
Vipul Mehta7-Feb-10 17:15
Vipul Mehta7-Feb-10 17:15 
Questionediting in gridview in asp.net with c# Pin
developerit7-Feb-10 0:45
developerit7-Feb-10 0:45 
AnswerRe: editing in gridview in asp.net with c# Pin
Brij7-Feb-10 1:53
mentorBrij7-Feb-10 1:53 
QuestionRetrieving the connection string from web.confi Pin
vempatiprasad6-Feb-10 18:33
vempatiprasad6-Feb-10 18:33 
I need help!!

I am working on a .NET project using C# with SQLServer as database.


I have 10users who access the web site with different user id and password.
Each user is having seperate database.
Based on each user id, i have to retrieve different connection string from web.config.
The same connection string will be used in each page, i access the database.

My question is..
how to retrieve the userid in each page? so that I can use it to retrieve the connection string in each page
rightnow I am retrieving the userid in login page and form authenticating with database.


public void LoginUser(Object s, EventArgs e)
{
bool blnAuthenticate = Authenticate(username.Text, password.Text);
if (username.Text == "AB....")
{
connString = WebConfigurationManager.ConnectionStrings["ABConnectionInfo"].ToString();
}
else if (username.Text == "CD....")
{
connString = WebConfigurationManager.ConnectionStrings["CDConnectionInfo"].ToString();
}
else if (username.Text == "EF....")
{
connString = WebConfigurationManager.ConnectionStrings["EFConnectionInfo"].ToString();
}
else if (username.Text == "GH..")
{
connString = WebConfigurationManager.ConnectionStrings["GHConnectionInfo"].ToString();
}
else if (username.Text == "IJ....")
{
connString = WebConfigurationManager.ConnectionStrings["IJConnectionInfo"].ToString();
}

if (blnAuthenticate)
{
FormsAuthentication.RedirectFromLoginPage(username.Text, false);
}
else
{
lblError.Text = "Your login was invalid. Please try again.";
}
}

bool Authenticate(string strUsername, string strPassword)
{

............
}

I appreciate help from anybody..Thank you
AnswerRe: Retrieving the connection string from web.confi Pin
MHASSANF7-Feb-10 1:09
MHASSANF7-Feb-10 1:09 
GeneralRe: Retrieving the connection string from web.confi Pin
vempatiprasad9-Feb-10 18:19
vempatiprasad9-Feb-10 18:19 
AnswerRe: Retrieving the connection string from web.confi Pin
Palash Biswas7-Feb-10 17:10
Palash Biswas7-Feb-10 17:10 
GeneralRe: Retrieving the connection string from web.confi Pin
Not Active7-Feb-10 18:27
mentorNot Active7-Feb-10 18:27 
GeneralRe: Retrieving the connection string from web.confi Pin
vempatiprasad10-Feb-10 7:42
vempatiprasad10-Feb-10 7:42 
AnswerRe: Retrieving the connection string from web.confi Pin
Krunal Berawala7-Feb-10 19:03
Krunal Berawala7-Feb-10 19:03 
GeneralRe: Retrieving the connection string from web.confi Pin
Not Active7-Feb-10 19:24
mentorNot Active7-Feb-10 19:24 
QuestionLinkButton and User Control Error Pin
AndyASPVB6-Feb-10 9:04
AndyASPVB6-Feb-10 9:04 
Questiondebugger does not get attached to a site Pin
sanjubaba6-Feb-10 2:54
sanjubaba6-Feb-10 2:54 
AnswerRe: debugger does not get attached to a site Pin
Abhijit Jana6-Feb-10 3:33
professionalAbhijit Jana6-Feb-10 3:33 
AnswerRe: debugger does not get attached to a site Pin
Abhishek Sur6-Feb-10 8:32
professionalAbhishek Sur6-Feb-10 8:32 
GeneralRe: debugger does not get attached to a site Pin
Hesham Amin7-Feb-10 10:05
Hesham Amin7-Feb-10 10:05 
GeneralRe: debugger does not get attached to a site Pin
Abhishek Sur7-Feb-10 10:13
professionalAbhishek Sur7-Feb-10 10:13 
QuestionCan't see localhost web application on custom web browser Pin
Yosh_5-Feb-10 23:47
professionalYosh_5-Feb-10 23:47 
Questionhow do i create website Pin
hi_everybody5-Feb-10 22:35
hi_everybody5-Feb-10 22:35 
AnswerRe: how do i create website Pin
Abhijit Jana5-Feb-10 22:37
professionalAbhijit Jana5-Feb-10 22:37 
AnswerRe: how do i create website Pin
sashidhar5-Feb-10 23:06
sashidhar5-Feb-10 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.