ReportViewer and dynamically created dataSet
I saw that the ReportViewer object can get its data from a class or a dataset.
If I use the dataset method I need to create a XSD file that the report will know. Is there a way to avo开发者_Go百科id creating this XSD file but still use datasets?Try using non-typed DataSet in your code on the fly. Create it, fill it and then set it as datasource. like following code :
SqlCommand mySelectCommand = New SqlCommand("select * from customers", myConnection);
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySelectCommand);
DataSet myDataSet = new DataSet();
mySqlDataAdapter.Fill(myDataSet,"Customers");
Use your myDataSet
wherever you want.
精彩评论