> If you write out Debug.WriteLine(dr["Session Duration
> Seconds"].GetType());, do you see int or string? I suspect string.
[quoted text clipped - 22 lines]
> Clay Burch
> Syncfusion, Inc.
Clay,
Thanks for that, yes its coming out as System.String, so my Colum Add
with the Type of System.Int32 obveiously isn't working.
The DataTable is actually being made up by copying from another data
structure in memory, I'm making it to DataTable so that I can use it
in Web stuff easily
the actual code is:
for (int i = 0; i < vbTable.GetLength(0); i++)
{
DataRow dr = dt.Rows.Add();
for (int j = 1; j < vbTable[i].GetLength(0); j++)
{
try
{
if (vbTable[i][j] != null)
{
dr[j] = vbTable[i][j].Value;
}
}
catch (System.NullReferenceException)
{
dr[j] = "";
}
}
}
although the only bit of that that actually does anything is
dr[j] = vbTable[i][j].Value;
which cycles through each of the colums on each of the rows adding the
STRING value from the source data structure. so yes, here it is a
string thats being passed. vbTable only contains strings.
However, becuase of the way I set the table up, at the point "Session
Duration Seconds" is copied across, I was expecting it to do a
conversion automaticlally...which obveiously isn't happening either!
How can I make that line so it converts to the appropriate type?
Thanks again...
Cliff.
Cliff - 29 Mar 2007 16:41 GMT
> > If you write out Debug.WriteLine(dr["Session Duration
> > Seconds"].GetType());, do you see int or string? I suspect string.
[quoted text clipped - 73 lines]
>
> - Show quoted text -
Got it...thanks guys...
I think it was a combination of the number overflowing from 32 to 64
bits and some crap coding on my part....
Thanks again.
Cliff.