[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What is C# equivalent of Dataset.Tables(0).Rows(x).Item("Blah") ???

Posted on 2005-05-17
2
Medium Priority
?
4,296 Views
Last Modified: 2012-05-05
Hi,

     I'm trying to port some VB code over into a C# app.  I'm having trouble with the way I deal with datasets.  In VB.NET I say:

newVar = Dataset_Name.Tables(0).Rows(x).Item("ColumnName")

in C# I've gotten as far as:

DataSet_Name.Tables[0].Rows[x].

but there seems to be no Item or equivalent.  Help!

JP
0
Comment
Question by:gleznov
2 Comments
 
LVL 3

Accepted Solution

by:
mpf1748 earned 1200 total points
ID: 14020037
You should be able to just add ["ColumnName"] to what you already have:

DataSet_Name.Tables[0].Rows[x]["ColumnName"]
0
 
LVL 7

Assisted Solution

by:jj819430
jj819430 earned 400 total points
ID: 14020481
one thing to be cautios is that you are getting an object back.

DataSet_Name.Tables[0].Rows[x] is a datarow (Array of objects)
... .Rows[x][ColumnName or Ordinal] == object
You have to convert it to the type you will be manipulating or deal with the direct object.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

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…
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

834 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