Click here to Skip to main content
13,045,631 members (68,844 online)
Rate this:
Please Sign up or sign in to vote.
See more:
When using wizard to add a new Data Source to the project, there are 4 options, one goes for Database, one goes for Service, one goes for Object and the last goes for Sharepoint. I'm focusing on Database and Object, these two options are almost the same in how they get data, both of them use SQL query to fetch data, the difference here is Database will get data from a procedure or function stored on the server whereas Object will get data from a method which executes some SQL query remotely. Using two of these options will make me re-create/re-execute my SQL statement to get data, which is very unnecessary because I already have a Dataset filled with data (for displaying in DataGridView), so why the hell do I have to re-execute the exact SQL statement I've executed when filling my Dataset?

To help you image the context more easily, I'll post some code here:

DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("My SQL SELECT query", mySqlConnection);

Now I want to add ds as a new DataSource for my local report, using wizard doesn't seem able to help, the new DataSource I want here can be created through the exact "My SQL SELECT query" above, that means ds is already what I want, however I don't know how to make it available for my local report's data source.

I hope you understand my problem here, I don't want to do thing which has already been done.

Thank you!
Posted 22-Mar-13 14:43pm
Updated 22-Mar-13 14:44pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100