views:

359

answers:

1

Today I researched about reportviewer to use it in my project. As I see the samples and tutorials in the web, We should create an dataset file to Solution Explorer and bind it to report viewer to show data.

However I want to create dataset programatically like sample code below. And I want to bind it.

Dim ds As New DataSet
DB_Gateway.myDataSet("select * from users", ds, "users")

How can I do it?

A: 

This blog entry goes into the details of what you want to do: http://blogs.msdn.com/magreer/archive/2008/10/16/setting-the-datasource-for-a-report-at-runtime.aspx

Matt Greer
Not sure why I got downvoted. That blog entry does show exactly what you are trying to do.
Matt Greer