Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a calculated field to a Strongly Typed Dataset
Message
From
27/08/2007 17:50:03
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
27/08/2007 17:22:22
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01250771
Message ID:
01250789
Views:
13
>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 started off with this in the .vb file of the DataSet:
>
>Partial Class PrescreenDataSet
>
>    Private columnStatus As System.Data.DataColumn
>
>    <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
>    Public ReadOnly Property StatusColumn() As System.Data.DataColumn
>        Get
>            Return columnStatus
>        End Get
>    End Property
>
>End Class
>
>
>but I don't know how to return a calculation from other fields. Anybody have a template for this?

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/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform