Re: Expression

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Mark,

Are you using this documentation?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatacolumnclassexpressiontopic.asp

Where is in


Example: myDataColumn.Expression="Convert(total, 'System.Int32')"

All conversions are valid with the following exceptions: Boolean can be
coerced to and from Byte, SByte, Int16, Int32, Int64, UInt16, UInt32,
UInt64, String and itself only. Char can be coerced to and from Int32,
UInt32, String, and itself only. DateTime can be coerced to and from String
and itself only. TimeSpan can be coerced to and from String and itself only.

I hope this helps,

Cor






"Mark" <Mark@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:3A89010D-370F-4673-99B8-229DAC074B71@xxxxxxxxxxxxxxxx
> I'm using VB. I'm talking about the Expression property in the DataColumn.
> It
> says it can convert a String to a TimeSpan in the documentation but I
> can't
> figure out how its done.
>
> Thanks
>
> "Mary Chipman [MSFT]" wrote:
>
>> Please post some code so someone can help. Conversion syntax isn't
>> interchangeable between C# and VB.
>>
>> --Mary
>>
>> On Wed, 5 Oct 2005 11:50:04 -0700, "Mark"
>> <Mark@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> >I see in the docuementation that the System.TimeSpan is supported in the
>> >CONVERT function for the DataColumn Expression property. How do I use
>> >it? I
>> >tried everything and I get InvalidCastExceptions.
>> >
>> >Thanks.
>> >Mark
>>


.


Quantcast