Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question on datatable
Message
De
02/03/2005 10:52:56
 
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00991965
Message ID:
00991991
Vues:
21
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform