Link to home
Start Free TrialLog in
Avatar of johnkainn
johnkainn

asked on

Datatable add int column to extisting table

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?
ASKER CERTIFIED SOLUTION
Avatar of LordOfPorts
LordOfPorts
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of icenhance
icenhance

thanks
Your welcome !