Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have create a dataset with vs designer with only one datatable name mydt
Now in code i have created an instance of my dataset




DataSet1 dsobj = new DataSet1();

I have a list campus which is assigned to a dt

DataTable dt = ToDataTable(campus);

MessageBox.Show(dt.Rows.Count.ToString()); // this shows 5 rows for instance

dsobj.mydt.Load(ToDataTable(campus).CreateDataReader());

MessageBox.Show(dsobj.spCampus_GetAll.Rows.Count.ToString()); // this shows 5 rows as well

but when i set crystal report source to dsobj.mydt
report.SetDataSource((System.Data.DataTable)dsobj.mydt);

upon loading crystal report viewer it does not show any entries despite i have added dataset field in my report

What I have tried:

DataTable dt = ToDataTable(campus);
MessageBox.Show(dt.Rows.Count.ToString()); // this shows 5 rows for instance
dsobj.mydt.Load(ToDataTable(campus).CreateDataReader());
MessageBox.Show(dsobj.spCampus_GetAll.Rows.Count.ToString()); // this shows 5 rows as report.SetDataSource((System.Data.DataTable)dsobj.mydt);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900