I have a really simple report I am trying to print from .Net 2002 using a Dataset as the data source, like I have 10 other times, but I keep getting the following error:
A first chance exception of type 'System.NullReferenceException' occurred in crdb_adoplus.dll
Additional information: Object reference not set to an instance of an object.
I have tried deleting the report and dataset and recreating them. I have reduced my dataset down to one field and changed which field that is and I have rebooted my machine a couple times.
It errors on the PrintToPrinter call.
Here is the stored proc I am using which returns one number when run from query analyzer and shows one record in the dataset when I debug it:
If I swap out the dataset for one that I know works it works OK, so the problem must be with the dataset, but it is so simple I just don't see where.
Thanks for any help you can offer.
A first chance exception of type 'System.NullReferenceException' occurred in crdb_adoplus.dll
Additional information: Object reference not set to an instance of an object.
I have tried deleting the report and dataset and recreating them. I have reduced my dataset down to one field and changed which field that is and I have rebooted my machine a couple times.
It errors on the PrintToPrinter call.
Code:
ReportClass crSchedule = new rptSampleSchedule();
// Get the counts
string sql = "usp_prdRptSampleSchedule";
SqlDataAdapter da = new SqlDataAdapter(sql, Utility.ConnectionMain(m_Config.AppRunEnvironment));
DataSet ds = new DataSet("SampleSchedule");
da.Fill(ds);
crSchedule.SetDataSource(ds);
// print it
crSchedule.PrintToPrinter(1,false,0,0);
Here is the stored proc I am using which returns one number when run from query analyzer and shows one record in the dataset when I debug it:
Code:
select TOP 1 s_shipqty from prd_PCsamples
If I swap out the dataset for one that I know works it works OK, so the problem must be with the dataset, but it is so simple I just don't see where.
Thanks for any help you can offer.