Solved

Set DataReader From Cache

Posted on 2010-11-09
2
382 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New to SOAP and need some direction 10 79
Error in JQuery 5 52
Help with C#, MVC, razor. 6 34
Media.Imaging 1 18
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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