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

Posted on 2005-05-17
Last Modified: 2012-05-05

     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:


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

Question by:gleznov
    LVL 3

    Accepted Solution

    You should be able to just add ["ColumnName"] to what you already have:

    LVL 7

    Assisted Solution

    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.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    jquery, aspx 10 34 mvc 2 30
    Build VS2015 project in bat command 3 54
    C# System Cannot Find File Specified Error 4 34
    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    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…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, 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…

    729 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

    20 Experts available now in Live!

    Get 1:1 Help Now