Set datatable's columns seperately - vb.net

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 vb.net?

Thanks in advance!
nahumbaAsked:
Who is Participating?
 
DhaestCommented:
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  
http://msdn2.microsoft.com/en-us/library/tat996zc(VS.80).aspx

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

        DataColumn dc = new DataColumn("IntegerExample",System.Type.GetType("System.Int32"));
        DataSetVariable.Tables["DataTableName"].Columns.Add(dc);

For more information
Adding DataColumn to a Dataset and DataTable
http://www.codersource.net/dataset_preparing_manual_data_addition.html
0
 
DhaestCommented:
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"

NorthwindDataSet1.Customers.Rows.Add(newCustomersRow)

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.