Set datatable's columns seperately -

Posted on 2007-07-25
Last Modified: 2013-11-26
Hi all,
I would like to know how can I set a datatable's columns in a row sperately. ie, I don't want to set all columns in one time, instead I would like to set columns values seperately - in different sections of my code.
How can I do that in

Thanks in advance!
Question by:nahumba
    LVL 53

    Expert Comment

    The following code can create a DataColumn with support for adding integer data rows.

            DataColumn dc = new DataColumn("IntegerExample",System.Type.GetType("System.Int32"));

    For more information
    Adding DataColumn to a Dataset and DataTable
    LVL 53

    Expert Comment

    How to: Add Rows to a DataTable  

    Dim newCustomersRow As NorthwindDataSet.CustomersRow
    newCustomersRow = NorthwindDataSet1.Customers.NewCustomersRow()

    --> here you can fill the columns you like to fill...
    newCustomersRow.CustomerID = "ALFKI"
    newCustomersRow.CompanyName = "Alfreds Futterkiste"


    LVL 53

    Accepted Solution

    Dim customersRow As NorthwindDataSet.CustomersRow
    customersRow = NorthwindDataSet1.Customers.FindByCustomerID("ALFKI")
    -->  Here you can change the columns you like
    customersRow.CompanyName = "Updated Company Name"
    customersRow.City = "Seattle"

    How to: Edit Rows in a DataTable


    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

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    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

    13 Experts available now in Live!

    Get 1:1 Help Now