I am trying to use the Report Viewer, but the Tablix data is blank
reportViewer1.LocalReport.DataSources.Add(newMicrosoft.Reporting.WinForms.ReportDataSource("Tablix1", NCategoria.Mostrar()));
Business Layer
ReportViewer
ColumnName:
DataLayer
public DataTable Mostrar()
{
DataTable DtResultado = new DataTable("categoria");
SqlConnection SqlCon = new SqlConnection();
try
{
SqlCon.ConnectionString = Conexao.Cn;
SqlCommand SqlCmd = new SqlCommand();
SqlCmd.Connection = SqlCon;
SqlCmd.CommandText = "spmostrar_categoria";
SqlCmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter sqlDat = new SqlDataAdapter(SqlCmd);
sqlDat.Fill(DtResultado);
}
catch
{
DtResultado = null;
}
return DtResultado;
}