Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on datatable
Message
From
02/03/2005 10:52:56
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00991965
Message ID:
00991991
Views:
22
You're very welcome, Dmitry! =)

~~Bonnie



>Bonnie and Cetin,
>
>Thank you both very much for your help. It does the job!
>
>>Dmitry,
>>
>>You need to use the .Expression Property of the Column:
>>
>>dstMyDataSet.Tables["MyTable"].Columns.Add("MyColumn3");
>>dstMyDataSet.Tables["MyTable"].Columns["MyColumn3"].Expression = "MyColumn1 + MyColumn2";
>>
>>
>>~~Bonnie
>>
>>
>>>I have a dataset with a datatable with 2 columns. I need to add a 3rd column that will be a concatenated of the other two.
>>>
>>>I figured the code of adding the column, as folows (and hopefully it is the right way):
>>>
>>>
>>>dstMyDataSet.Tables["MyTable"].Columns.Add("MyColumn3");
>>>
>>>
>>>But I can't figure out how to make this column, MyColumn3 to be populated as a sum of the other two columns.
>>>
>>>Thank you in advance for any suggestions and help.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform