开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜