ReportViewer on the fly?
Posted on 2006-05-24
Simply, I have a DataSet/DataTable which is filled from a specific and dynamic SQL Select statement, how could I view that Table in a ReportViewer control (not CrystalReportViewer control). Below my code:
string MyConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="Customers.mdb";
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM Customers", MyConnectionString);
// The SQL Select statement above could be anything else (I am getting it from user's input)
// What code should I put here so that the DataTable 'dt' could be viewed in the ReportViewer control
I am new on ths issue, and I am wondering if I could do this on the fly (dynamically/programatically) because I am not using any DataSource on my application. My application is just to print a given (dynamic) DataTable.
I am using C# .NET 2.0