Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/01/2011, 18:42
Avatar de gakutaru
gakutaru
 
Fecha de Ingreso: agosto-2005
Ubicación: frente a mi NtbK
Mensajes: 239
Antigüedad: 19 años, 6 meses
Puntos: 6
Respuesta: como traer datos de una base de datos a una pagina en asp.net

Para leer desde MS SQL
Código C:
Ver original
  1. ...
  2. string strSelectReportes = "Select * From Reportes";
  3. SqlCommand cmdSelectReportes = default(SqlCommand);
  4. SqlDataReader dtrSelectReportes = default(SqlDataReader);
  5. conReportes.Open();
  6. cmdSelectReportes = new SqlCommand(strSelectReportes, conReportes);
  7. dtrSelectReportes = cmdSelectReportes.ExecuteReader();
  8. while (dtrSelectReportes.Read())
  9. {
  10. Response.Write(dtrSelectReportes["fchReporte"].ToString());
  11. }
  12. conReportes.Close();
  13. ....