
13/08/2012, 09:45
|
 | | | Fecha de Ingreso: mayo-2011
Mensajes: 39
Antigüedad: 13 años, 8 meses Puntos: 0 | |
Respuesta: No puedo enlazar ComboBox con tabla de BBDD Estimado, yo hice esto para agregar un valor, espero poder ayudar con este granito y que tomes la logica, saludos.
cbId.Items.Clear();
DataTable dt = new DataTable();
SqlCommand cmd = new SqlCommand("select id from usuarios",conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
string valorItem;
for (int i = 0; i < dt.Rows.Count; i++)
{
valorItem = (String)dt.Rows[i]["id"];
cbId.Items.Add(valorItem);
} |