Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 6th, 2006, 01:46 PM
Registered User
Join Date: Oct 2006
Location: Newport Beach, , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Persoalization problem...

I have a problem. i am using personalization to load values on the login page.
    protected void Login1_LoggedIn(object sender, EventArgs e)
        string userName = Login1.UserName;
        string password = Login1.Password;

        string query1 = @"SELECT Security.SubscriberID, Security.UserTypeID, Subscribers.Lastname + ', ' + Subscribers.Firstname AS Fullname, Subscribers.Medid, Security.registrationnum FROM Security INNER JOIN Subscribers ON Security.SubscriberID = Subscribers.SubscriberID WHERE UserName = @UserName AND Pwd = @Password";
        string conn1 = (string)ConfigurationManager.ConnectionStrings["typhoonConnectionString1"].ConnectionString;
        SqlConnection myconn = new SqlConnection(conn1);
        SqlCommand command = new SqlCommand(query1, myconn);
        command.Parameters.AddWithValue("@UserName", userName);
        command.Parameters.AddWithValue("@Password", password);
        SqlDataReader reader = command.ExecuteReader();
        Profile.doctors.subscriberid = (String.Format("{0}", reader[0]));
        Profile.doctors.usertype = (String.Format("{0}", reader[1]));
        Profile.doctors.fullname = (String.Format("{0}", reader[2]));
        Profile.doctors.medid = (String.Format("{0}", reader[3]));
        Profile.doctors.registrationnum = (String.Format("{0}", reader[4]));

I am reading Profile.doctors.fullname on my masterpage, but the problem is that it is not loading the correct data, de data is delay. If you sign with username1 i can not see the values, and if after that you singn with username2 the values are from the username1.

On my masterpage

 LoginName name = (LoginName)LoginView2.FindControl("LoginName1");
        name.FormatString = Profile.doctors.fullname;

But it is not working, i was testing using Response.Write(Profile.doctors.fullname); to see the data and it is alway wrong.

The query works perfect on sql analyzer, but i dont know why i am not loading the data on the profile on my web.config page.

Please help...



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

All times are GMT -4. The time now is 09:54 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.