Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/09/2009, 12:28
mad249
 
Fecha de Ingreso: septiembre-2009
Mensajes: 111
Antigüedad: 14 años, 8 meses
Puntos: 3
SOLUCION: LLenar varios TEXTBOX con Datos de un DATASET usando Un DROPDOWNLIST como

MUCHAS GRACIAS... PERO YA LO RESOLVÍ por Otro Lado.. DE echo es similar a lo que mencionas.. MI Código ESTABA ASÍ:

Código PHP:
public partial class Clientes System.Web.UI.Page
    
{
        
#region Variable Conexion
        /// <summary>
        /// Declaracion de las Variables
        /// </summary>
        
BaseDatos bd = new BaseDatos();
        
#endregion

        
DataSet dsClientes;//ESTE ES MI DATASET

//ENLAZADOR DE DATOS DEL COMBOBOX AL CAMPO LLAVE(ID)
        
private void cboIdCliente_DataBind()
        {

            
dsClientes DAL.Clientes.Lista(bd.conexion, (int)eClientes.Lista);//Linea Ejecuta un Listado MEdiante Mi STore Procedure, 
            
cboIdCliente.DataSource dsClientes.Tables[0].DefaultView;//Asignacion al CmboBox o DropDownList
            
cboIdCliente.DataTextField "IdCliente";
            
cboIdCliente.DataValueField "IdCliente";
            
cboIdCliente.DataBind(); //Linea de Enlace

        
}

//CARGA de VALORES DEPENDIENDO DEL IDENTIFICADOR DE REGISTRO
 
private void carga_Valores()
        {
            
//ASIGNACION DE VARIABLES CON LOS DATOS DEL DATASET
            
string sNombre dsClientes.Tables[0].Rows[0]["Nombre"].ToString();
            
string sApellidoPatdsClientes.Tables[0].Rows[0]["ApellidoPat"].ToString();
            
string sApellidoMatdsClientes.Tables[0].Rows[0]["ApellidoMat"].ToString();
           
            
//ASIGNACION DE LAS VARIABLES A LOS TEXTBOX
            
txtBox1.Text sNombre;
            
txtBox2.Text sApellidoPat;
            
txtBox3.Text sApellidoMat;

        }

protected 
void Page_Load(object senderEventArgs e)
        {
             
cboIdCliente_DataBind();
        }

//...CODIGO OMITIDO PARA COMPRENSION


Espero Que ESto les sirva... ya tenía todo listo pero no tenía idea de como IDENTIFICAR el ID y que este me sirviera para llenar los datos en los TEXTBOXS, pero solo hacía falta crear nuevamente(no es nuevo, pero sobreescribe asi mismo) el DATASET cuando ya tuviera un indicador... y la SOLUCION ME QUEDÓ ASí...
Código SOLUCION:
Ver original
  1. //ASGINACION DEL IDENTIFICADOR DE REGISTRO AL SELECCIONARLO DEL DROP/CBOX
  2.  protected void cboIdCliente_SelectedIndexChanged(object sender, EventArgs e)
  3.         {
  4.             int IdCliente = int.Parse(cboIdCliente.SelectedValue.ToString());
  5.  
  6.             dsClientes = DAL.Clientes.SelectByID(bd.conexion, (int)eClientes.SelectById, IdCliente);//USO DE OTRO STORE PROCEDURE DONDE SE SELECCIONAN LOS CAMPOS SEGUN LA LLAVE PRIMARIA(ID)
  7.  
  8.             carga_Valores();
  9.         }
  10.  
  11. //EN EL PAGE LOAD
  12.         protected void Page_Load(object sender, EventArgs e)
  13.         {
  14.  
  15.             if (!Page.IsPostBack)
  16.             {
  17.                 cboIdCliente_DataBind();
  18.                 carga_Valores();
  19.             }
  20.  
  21.         }
  22.  
  23. //...Código Removido Para comprensión
  24.  
  25. }

GRACIAS por tu APoyo MDAVILA... ESPERO SI alguien les sirva, no los haya confundido... Los Store Procedures son TEMA APARTE... SALUDOS!

Atte. Ing. Miguel Dávila

Última edición por mad249; 10/11/2009 a las 11:48 Razón: CERRAR