Using SqlDataReader with Smart Markers

Hi,

Lets say I have my Store Procedure returns a DataSet of 3 tables. The 1st and 3rd table are very small while the 2nd table is huge with 100K+ records. I am using Smart Markers and so far been using DataTable option for 2nd table but I am seeing performance issues. How am I suppose to use below method for my 2nd Table if my smart markers are “MyTable.Column1, MyTable.Column2” etc.

SetDataSource(string name, IDataReader dataReader, int **rowCount**)

Also, what if I don’t know rowCount above?

@programmerboy,

Thanks for providing us some details.

Please create a simple console application, zip the project and provide us here with all the files (input and output, etc.) to show the issue. Also, create dynamic datatables in the code to remove any inter dependencies of external data source or database, so we could execute your project without any issue. We will check it soon.

Also, see the description for the rowCount parameter in SetDataSource() overloaded method:
The number of the data rows. If the smart marker does not contains “noadd”, we have to insert rows by the row count for performance issue and dynamic repeated formulas. -1 means the param is useless.

Thanks, Amjad. I was looking at a code snippet instead of writing the whole program myself. Anyways, I was able to get the answer myself.

As for the rowCount parameter, I read the description before posting and I wasn’t too sure how it works if we supply -1. We don’t have “noadd” and neither we know number of data rows.

@programmerboy,

Good to know that your issue is sorted out by the suggested line of code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.