Solved

Set DataReader From Cache

Posted on 2010-11-09
2
359 Views
Last Modified: 2012-05-10
I'm working with a third party tool that needs to be provided with an instance of IDataReader for a specific call.  THis has been working fine, but now I have a situation where the data I need to pass to the method is not coming from a database, but is effectively cached in the application.  So I have a List of Dictionary<string, Object> items that needs to be put into a DataReader.

Is there any way to do this?  Can I somehow point a Connection.DataSource to a C# object, maybe a DataTable?

jkavx
0
Comment
Question by:jkavx
2 Comments
 
LVL 13

Accepted Solution

by:
AngryBinary earned 500 total points
Comment Utility
Can you load the data in your Dictionary to a DataTable? The DataTable object has a "CreateDataReader()" method that returns an IDataReader for the rows in that table.

Otherwise, you can implement the IDataReader interface in a new class that feeds data from a Dictionary object.
0
 

Author Closing Comment

by:jkavx
Comment Utility
CreateDataReader() is what I was looking for.  Thx.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now