Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a calculated field to a Strongly Typed Dataset
Message
De
29/08/2007 11:13:09
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
29/08/2007 10:59:56
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01250771
Message ID:
01251159
Vues:
10
Bonnie,
Thanks... I'll check it out.

No worries about the C#. You have answered so many of my questions that I have gotten used to coverting... ;-)

>Mike,
>
>I bet you're missing the part where you have to tie it in to a specific table. I looked at some of my Typed DataSet code that was generated by VS, and there's always code like this (and sorry, this will be C# ... you can use the code converter of your choice to get the VB code ... sorry, limited time for me this morning):
>
>
>public class PrescreenRow : System.Data.DataRow
>{
>    private MyPrescreenTable tablePrescreen;
>
>    internal PrescreenRow(System.Data.DataRowBuilder rb) : base(rb)
>    {
>        this.tablePrescreen = (MyPrescreenTable)this.Table;
>    }
>}
>
>
>Look at some of the code generated by your Typed DataSets and see if you have similar stuff. I bet this is all you're missing (but I won't swear to it ... just a guess <g>).
>
>~~Bonnie
>
>
>
>
>
>>>I want to add a calculated field to my DataSet, similar to how I would add a ReadOnly Property to my class that returned a calculation based on other Properties.
>>>
>>I modified my code and now have this:
>>
>>Partial Class PrescreenDataSet
>>
>>    Partial Public Class PrescreenRow
>>        Inherits System.Data.DataRow
>>
>>        Public ReadOnly Property Status() As String
>>
>>            Get
>>                Return "TEST"
>>            End Get
>>
>>        End Property
>>
>>    End Class
>>
>>End Class
>>
>>
>>This works when I evaluate the value, but it won't bind to a datagrid. Is there something special I have to do?
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform