Solved

Set DataReader From Cache

Posted on 2010-11-09
2
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
AngryBinary earned 500 total points
ID: 34098438
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
ID: 34098490
CreateDataReader() is what I was looking for.  Thx.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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