G
Guest
hi,
I have an issue with datarow and itemarray.
In a datatable I have followong datas :
OPS 014E
OPS <NULL>
I perform a foreach on each datarow like this :
foreach(DataRow dr in aTable.Rows)
{
object[] o = dr.ItemArray
string s1 =
(o[0] != DBNull.Value) ? Convert.ToString(o[0]) : string.Empty;
string s2 =
(o[1] != DBNull.Value) ? Convert.ToString(o[1]) : string.Empty;
}
During my second loop, the value for s2 is 014E and not null
It's strange.
Do you have an idea to solve my problem ?
thanks for your help
best regards
Freddyboy
I have an issue with datarow and itemarray.
In a datatable I have followong datas :
OPS 014E
OPS <NULL>
I perform a foreach on each datarow like this :
foreach(DataRow dr in aTable.Rows)
{
object[] o = dr.ItemArray
string s1 =
(o[0] != DBNull.Value) ? Convert.ToString(o[0]) : string.Empty;
string s2 =
(o[1] != DBNull.Value) ? Convert.ToString(o[1]) : string.Empty;
}
During my second loop, the value for s2 is 014E and not null
It's strange.
Do you have an idea to solve my problem ?
thanks for your help
best regards
Freddyboy