Getting information from a datarow

Posted on 2007-07-24
Last Modified: 2010-04-15
Hi, how do you read information from a datarow?  I have a datarow which I populate and now i want to pull out information from it.
Question by:mitesh114
    LVL 29

    Expert Comment

    by:Gautham Janardhan
    dataror["columnname"] will give u the value.

    Author Comment

    How do I loop through the entire data??
    LVL 29

    Accepted Solution

    like ho do u have the data.. in a data table ?

    for(int i=0;i<FTAble.Rows.Count;i++)
       object Data = Ftable.Rows[i]["ColumnName"];
    LVL 22

    Assisted Solution

    The previous post loops over rows from a data table. If instead, you want to loop over the columns in a single row:
    int count = myDataRow.Columns.Count;
    string content;
    for (index = 0; index < count; i++)
       content = myDataRow.Columns[index].ToString();
    LVL 22

    Expert Comment

    Bob - I'm still interested. Will support whatever you suggest.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    728 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

    19 Experts available now in Live!

    Get 1:1 Help Now