--Mary
On Wed, 5 Oct 2005 11:50:04 -0700, "Mark"
<Ma...@discussions.microsoft.com> 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
Thanks
Are you using this documentation?
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" <Ma...@discussions.microsoft.com> schreef in bericht
news:3A89010D-370F-4673...@microsoft.com...
I have tested it and probably the same problem as you. I have placed your
question completely documented in another place as question and saved your
message. I hope that I can answer you soon.
If Mary will investigate it, I made this test
\\\
Dim dt As New DataTable
dt.Columns.Add("mystring", Gettype(System.String))
dt.Columns.Add("myDate", GetType(System.TimeSpan), _
"Convert(mystring, 'System.TimeSpan')")
dt.LoadDataRow(New Object() {"00:01:00"}, True)
'Error above, it is telling me that the conversion does not go
///
Cor
Dim dt As New DataTable
dt.Columns.Add("mystring", GetType(System.String))
dt.Columns.Add("myDate", GetType(System.TimeSpan))
Dim newRow(1) As Object
newRow(0) = "Hello"
newRow(1) = TimeSpan.Parse("00:00:00")
dt.LoadDataRow(newRow, True)
--Mary
That is no expression, an expression functions by instance as well direct
after that somebody commit the row as somebody changes a string in by
instance a windowsform datagrid. Your sample is a one time action.
For us is the status now that we think that it is a documentation bug,
because the code to do this is not direct in Net, however I did not get
enough replies to tell this.
Cor
"Mary Chipman [MSFT]" <mc...@online.microsoft.com> schreef in bericht
news:q3mlk1hshkhi7igvf...@4ax.com...
--Mary
On Tue, 11 Oct 2005 08:32:34 +0200, "Cor Ligthert [MVP]"
There are in my opinion not much people that use the web client for these
newsgroups.
So I am not and therefore there is no button, however I have placed this
problem somewhere else and wait first what will be the result of that.
Cor
--Mary
I have sent it, there is a cc to you, good work in my idea from you.
Cor
--Mary