A
Alcibiade
Hi guys,
I have to store some values from an array to a datarow
Sometime I get an error because the type is different that than
expected.
How can I solve?
I wrote this:
foreach (Object obj in array )
{
Type current_type = datarow.GetType();
try
{
datarow = Convert.ChangeType(obj, current_type);
}
catch
{
datarow = obj;
}
i++;
But for example if the expected type of the row is Int32 it doesn't
work.
thanks a lot
I have to store some values from an array to a datarow
Sometime I get an error because the type is different that than
expected.
How can I solve?
I wrote this:
foreach (Object obj in array )
{
Type current_type = datarow.GetType();
try
{
datarow = Convert.ChangeType(obj, current_type);
}
catch
{
datarow = obj;
}
i++;
But for example if the expected type of the row is Int32 it doesn't
work.
thanks a lot