Ver Mensaje Individual
  #5 (permalink)  
Antiguo 11/12/2004, 07:42
jsaviola
 
Fecha de Ingreso: abril-2002
Ubicación: Montevideo
Mensajes: 98
Antigüedad: 22 años
Puntos: 0
Cargar los datos los carga bien. O al menos me carga los valores en forma correcta (<select name=xx> <option value="1">desc1</option>....</select>)

Así cargo el dropdownlist:

_______________
this.sqlConn.Open();

this.sqlComm.CommandText = "web_Consultas";
this.sqlComm.CommandType = System.Data.CommandType.StoredProcedure;
this.sqlComm.Connection = this.sqlConn;
this.sqlComm.Parameters.Add(new System.Data.SqlClient.SqlParameter("@operacion", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, "P"));

this.sqlDR = this.sqlComm.ExecuteReader();

this.optPais.DataSource = this.sqlDR;
this.optPais.DataTextField = "pai_descripcion";
this.optPais.DataValueField = "pai_id";
this.optPais.DataBind();
this.sqlConn.Close();

this.optPais.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Seleccionar país", "0"));
_______________


y así intento recuperarlo:
_______________
this.sqlComm.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Pai_ID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, System.Convert.ToInt32(this.optPais.SelectedIndex) ));
______________

Gracias y acepto sugerencias y consejos si ven algo que podría estar mejor.
Saludos,

jsaviola