Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on datatable
Message
 
 
To
02/03/2005 10:32:08
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00991965
Message ID:
00991988
Views:
15
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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform