Advertisement

06.20.2008 at 10:42AM PDT, ID: 23503013
[x]
Attachment Details

Datatable add int column to extisting table

Asked by johnkainn in .NET, C# Programming Language

Tags: C#

I have got a datatable with several rows. I want to add a column of type int.
If I do following I get an error: 'dataType' argument cannot be null.
Parameter name: dataType

 ds.Tables[0].Columns.Add("NewId", System.Type.GetType("System.Int"));

After I have created the column I will loop through the rows in the table and fill values in the new column. How can I add this new int column?Start Free Trial
 
Loading Advertisement...
 
[+][-]06.20.2008 at 10:50AM PDT, ID: 21833320

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, C# Programming Language
Tags: C#
Sign Up Now!
Solution Provided By: LordOfPorts
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.20.2008 at 10:52AM PDT, ID: 21833340

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628