Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET Espanol
|
ASP.NET Espanol Esta es una lista de correo dedicada al intercambio de conocimiento sobre ASP.NET en el idioma español.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET Espanol section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2006, 01:55 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problema de atraso en el profile

tengo un problema, estoy usando login control, al mismo tiempo que se firma un usuario nuevo, necesito leer algunos datos de algunas tablas, y el query funciona perfectamente, desafortunadamente al cargar los datos en el profile estan atrasados.

es decir, si se firma el usuario1 al entrar no se carga su nombre, pero el query si funciona, y cuando despues de este usurario firma un usuario2 en este se cargan los datos de usuario1 y asi sucesivamente y en veces no carga los valores necesarios, pero el query jamas me da un error, siempre esta cargando los datos.

como puedo, cargar los datos que me da este qery y guardarlos para su uso en el masterpage y otras paginas posteriores. esto tiene que se en el login.aspx

Gracias

    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);
        myconn.Open();
        SqlDataReader reader = command.ExecuteReader();
        reader.Read();
        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]));
        reader.Close();
        myconn.Close();
    }


este es un ejemplo de domo leo despues los datos para ser leidos en el, masterpage.

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

Luis








Similar Threads
Thread Thread Starter Forum Replies Last Post
Problema accediendo a un Procedimiento en Oracle Baphomet ASP.NET Espanol 0 September 14th, 2007 03:06 AM
problema con dos tablas en oracle charoluque SQL Language 3 August 14th, 2006 02:18 PM
problema en conexion a oracle jakepc ASP.NET Espanol 0 April 27th, 2005 10:24 AM
Error al registrar dll hecha en vb.net en el COM+. amantona ASP.NET Espanol 0 April 13th, 2004 02:32 AM





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