Modify C# Dataset

Posted on 2006-04-10
Last Modified: 2009-01-26

I have a dataset that was populated from the database. I want to modify the second column of every row. Its a multiple tier system and I can not modify it with the sql. I need to modify the dataset. Could someone either give me a quick code snippet or point me to an online source or tutorial where this is done? The data types of all the columns are string.

Question by:charlesbaldo
    LVL 7

    Accepted Solution

    foreach (DataRow row in dataset.table["tablename"].rows)
    dataset.table["tablename"].Rows[1][row] = "some value"; //where 1 is the 2nd column

    hope this helps.


    Author Comment

    Thanks o it works

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    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…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now