I have a problem in my Windows Forms application. My report does not show anything, I don't know what the problem is. I want to create a report with a specific query from SQL Server 2008 and add conditions, but I just write the query without condition and is showing nothing, my database is not empty.
I have this code:
SqlConnection Conne = new SqlConnection("Data Source=GONZALO\\SQLEXPRESS;Initial Catalog=DATABASE;Integrated Security=true");
Conne.Open();
ReportedeMant Informe2 = new ReportedeMant();
RMant rll2 = new RMant();
string query = "SELECT * FROM Mantenimientos M " +
"INNER JOIN Canales C ON M.IDCanal=C.IDCanal " +
"INNER JOIN Region R ON M.IDRegion=R.IDRegion " +
"INNER JOIN Equipos E ON M.Serie = E.Serie " +
"INNER JOIN Fallas F ON M.IDTipoFalla = F.IDTipoFalla " +
"INNER JOIN Problema_Mantenimiento PM ON M.IDProblema = PM.IDProblema " +
"INNER JOIN Resultado_Mant RM ON M.IDResultado = RM.IDResultado " +
"INNER JOIN Servicio S ON M.IDServicio = S.IDServicio " +
"INNER JOIN TipoMantenimiento TM ON M.IDTipoMant = TM.IDTipoMant " +
"INNER JOIN Clientes Cli ON M.CodigoCliente = Cli.CodigoCliente";
// DatabaseDataSet dsLS = new DatabaseDataSet ();
DataSet dsLS = new DataSet();
SqlCommand com = new SqlCommand(query,Conne);
try
{
SqlDataAdapter q = new SqlDataAdapter(com);
q.Fill(dsLS);
Informe2.SetDataSource(dsLS);
rll2.crystalReportViewer1.ReportSource = Informe2;
}
catch (Exception eex)
{
MessageBox.Show(eex.Message);
}
rll2.Show();