开发者

ReportViewer and dynamically created dataSet

开发者 https://www.devze.com 2023-03-24 16:47 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消