C sharp - Pasar datos

 
Vista:
sin imagen de perfil

Pasar datos

Publicado por Jose Germán (2 intervenciones) el 28/11/2017 10:57:02
Buenos días

Estoy intentando hacer un reporview con MySql y Visual.
La DB esta tipada para poder poner los campos en el Report, pero me aparece en blanco al ejecutarlo

Cargo en un dataset los datos con la consulta al MySql y los paso al DataSet tipado.
No se que hago mal, este es el código

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
MySqlConnection conn = BdComun.ObtenerConexion();
 
string consulta = "SELECT tbl_depart.fld_locali, tbl_depart.fld_coddep, " +
    "tbl_pedido.fld_codcon, tbl_pedido.fld_nomcon, tbl_pedido.fld_codcam, tbl_pedido.fld_codcis, tbl_pedido.fld_viaje, " +
    "tbl_pedido.fld_nomges, tbl_pedido.fld_nomdep, tbl_pedido.fld_fprogr, " +
    "tbl_peddet.fld_entreg, tbl_peddet.fld_recoge, tbl_peddet.fld_nomres, tbl_peddet.fld_nomenv, tbl_peddet.fld_codenv, " +
    "tbl_peddet.fld_obsres " +
    "FROM tbl_pedido " +
    "INNER JOIN tbl_depart ON tbl_pedido.fld_coddep = tbl_depart.fld_coddep " +
    "INNER JOIN tbl_peddet ON tbl_pedido.fld_codigo = tbl_peddet.fld_codped " +
    "where tbl_pedido.fld_fprogr = " + (string.IsNullOrEmpty(txtFechaProgramacion.Text) ? "0"
    : Convert.ToDateTime(txtFechaProgramacion.Text).ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture)) + " " +
    "order BY fld_viaje, fld_codcam, fld_codcis ";
 
MySqlCommand cmdListadosCarga = new MySqlCommand(consulta, conn);
 
MySqlDataReader myReader;
myReader = cmdListadosCarga.ExecuteReader();
 
 
dsInformes.dtListadoCargaDataTable DSI = new dsInformes.dtListadoCargaDataTable();
 
while (myReader.Read())
{
    DataRow fila = DSI.NewRow();
 
    fila["fecha"] = myReader.GetString("fld_fprogr");
    fila["conductor"] = myReader.GetString("fld_nomcon");
    fila["codigoConductor"] = myReader.GetString("fld_codcon");
    fila["codigoCamion"] = myReader.GetString("fld_codcam");
    fila["codigoRemolque"] = myReader.GetString("fld_codcis");
    fila["codigoDepartamento"] = myReader.GetString("fld_coddep");
    fila["departamento"] = myReader.GetString("fld_nomdep");
    fila["localidad"] = myReader.GetString("fld_locali");
    fila["residuoArticulo"] = myReader.GetString("fld_nomres");
    fila["gestor"] = myReader.GetString("fld_nomges");
    fila["viaje"] = myReader.GetString("fld_viaje");
    fila["entrega"] = myReader.GetString("fld_entreg");
    fila["recoge"] = myReader.GetString("fld_recoge");
    fila["envase"] = myReader.GetString("fld_nomenv");
    fila["codigoEnvase"] = myReader.GetString("fld_codenv");
    fila["observaciones"] = myReader.GetString("fld_obsres");
 
    DSI.Rows.Add(fila);
}
 
myReader.Close();
 
Gis.Rpt.FrmRptListadoCargas frm = new Gis.Rpt.FrmRptListadoCargas();

Gracias de antemano
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Enrique
Val: 189
Bronce
Ha mantenido su posición en C sharp (en relación al último mes)
Gráfica de C sharp

Pasar datos

Publicado por Enrique (69 intervenciones) el 01/12/2017 23:30:05
Creo nunca le mandas la información a tu control por que no veo alguna propiedad DataSource o alguna llamada al método DataBind()
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar