NEWBIE: What C# object is closest to Java ResultSet?

Dear Experts,

I'm converting an app from Java to C# (at which I'm a newbie).  I'm just getting exposed to the ADO.NET "disconnected" data model.  In Java, I had been relying exclusively on "ResultSets", which are "connected".  Apparently, I'll need to learn something different in ADO.NET.  

My particular app was modeled on (ported from, actually) a main-frame batch program.  When it's "back-end processing" runs, it's guaranteed to be the only app running against the entire db at that time.  

Given this, it seems to me like I don't care about whatever new wrinkles ADO.NET might have regarding data access.  My old "ResultSets" should work just fine.  (This is for the "back-end processing only.  The UI for my app is a different story, to be covered in a later question.)

So I have two questions:  Do you think my previous paragraph is true?  And if so, what is the closest corollary C# has to a Java "ResultSet"?

Thanks again!
--BrianMc1958
BrianMc1958Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gbzhhuCommented:

Your statement according to me is correct.  Your situation doesn't call for disconnected data access (simplistically explained here for your reference  
http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson05.aspx

The closest object in .NET to resultset is to be Command object (SQLCommand)
0
BrianMc1958Author Commented:
BTW: I ask this in particular because the VS2005 "Java-to-C# Converter" converted my ResultSet objects to OleDbDataReader objects.  Should I trust it?
0
Carl TawnSystems and Integration DeveloperCommented:
The C# equivalent would be the SqlDataReader (or OleDbDataReader etc depending on your DB).

The DataReader is a connected result set. The downside is that it is a forward-only result set, which may or may not be suitable for your needs.

If you need more than forward-only access then you are stuck with a disconnected DataSet.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Fahad MukhtarDistinguished EngineerCommented:
>>What C# object is closest to Java ResultSet?

It is DataReader which is connected, forward only ,read only data object
0
gbzhhuCommented:
I read ResultSet as Recordset, so please ignore my comment and I agree with others DataReader it is
0
BrianMc1958Author Commented:
To gbzhhu: Thanks for the link.  It's really great.  I'm reading the whole thing.  Then maybe I won't have to bother you all so much.

To everybody:  As a (brand)newbie, I can't tell which of you is right.  gbzhhu says SqlCommand, and carl tawn and Desp say DataReader (which the VS2005 Java Converter agrees with.)  I'm going to study gbzhhu's ADO link before awarding points, unless maybe you folks could clear this up for me.

Thanks again,
BrianMc1958  
0
BrianMc1958Author Commented:
To everybody:  The previous two posts crossed in the mail.  Got it now!  Thanks again!
--BrianMc1958
0
Carl TawnSystems and Integration DeveloperCommented:
The SqlCommand object doesn't contain any data. It is used to store and execute commands on a connection that return data.
0
BrianMc1958Author Commented:
BTW: Would like to award some points just for the great ADO link.  I really needed it...
0
BrianMc1958Author Commented:
BTW #2:  I assume when two people give me the same correct answer, I'm supposed to award all the points to the first one?  Is that right?  Or am I supposed to split points?  I would hate to insult someone who's taking the time to help me out!
--BrianMc1958
0
gbzhhuCommented:
BrianMc1958

As far as I know there are no hard rules when 2 people give 2 similar answers.  You could accept the first one or split.  What I normally do is split but offer the first expert to answer a little more say 60% to expert who answered first and 40% for the other.  Either approach is fine with most experts.  
0
BrianMc1958Author Commented:
OK.  Thanks...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.