Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/01/2010, 10:39
gamaro
 
Fecha de Ingreso: diciembre-2009
Mensajes: 69
Antigüedad: 14 años, 4 meses
Puntos: 1
Mandar un informe de un dataset

Miren tengo un pequeño inconveniente
estoy haciendo esto:

tengo varias consulta y el resultado lo meto a un dataset
ahora lo qu eestoy tratando de hacer es
en un solo reporte de crystal report mandar el resultado de todas esas consultas
en este caso
No se si debo de crear un dataset mas para almacenar el resultado de todas las consultas
pues ya que todos los dataset se relacionan mediante un id


Código:
 OleDbConnection conexion = new OleDbConnection();
            conexion.ConnectionString = @"Provider = Microsoft.Jet.OleDb.4.0; Data Source=C:\BDasystec\db_parserMaster.mdb";
            conexion.Open();

            ////////1 
            OleDbDataAdapter da = new OleDbDataAdapter();
            OleDbCommand comando = new OleDbCommand();
            comando.Connection = conexion;
            comando.CommandText = "select id,count(lugar_in) from asistencia where fecha_in>=#" + textBox1.Text + "# and fecha_in<=#" + textBox2.Text + "# group by id,hora_in having (((hora_in)=\" \" Or (hora_in) Is Null Or (hora_in)=\" \")) ";
            da.SelectCommand = comando;
            da.Fill(dataSet11, "Tabla1");
          
///////////////////////////////2
            OleDbDataAdapter da2 = new OleDbDataAdapter();
            OleDbCommand comando2 = new OleDbCommand();
            comando2.Connection = conexion;
            comando2.CommandText = "select id,count(lugar_out) from asistencia where fecha_in>=#" + textBox1.Text + "# and fecha_in<=#" + textBox2.Text + "# group by id,hora_out having (((hora_out)=\" \" Or (hora_out) Is Null Or (hora_out)=\" \")) ";
            da2.SelectCommand = comando2;
            da.Fill(dataSet11, "Tabla2");


            ////////3 
            OleDbDataAdapter da3 = new OleDbDataAdapter();
            OleDbCommand comando3 = new OleDbCommand();
            comando3.Connection = conexion;
            comando3.CommandText = "select id,count(lugar_in2) from asistencia where fecha_in>=#" + textBox1.Text + "# and fecha_in<=#" + textBox2.Text + "# group by id,hora_in2 having (((hora_in2)=\" \" Or (hora_in2) Is Null Or (hora_in2)=\" \")) ";
            da3.SelectCommand = comando3;
            da3.Fill(dataSet11, "Tabla3");