G
Guest
I have a DataTable (over 32,000 rows) with 19 columns of which I need to fix
some data in two of them in order to import the data into a SQL table. I
have a for loop but I can't figure out the if statement to find the 'bad'
columns so I edit them. This is what I have but it isn't working.
for (int i = 0; i < dtTmpTable.Rows.Count; i++)
{
if (dtTmpTable.Rows["Create Date"] == "00/00/0000") <-- not working
{
dtTmpTable.Rows["Create Date"] = DBNull.Value;
}
}
dtTmpTable.AcceptChanges();
some data in two of them in order to import the data into a SQL table. I
have a for loop but I can't figure out the if statement to find the 'bad'
columns so I edit them. This is what I have but it isn't working.
for (int i = 0; i < dtTmpTable.Rows.Count; i++)
{
if (dtTmpTable.Rows["Create Date"] == "00/00/0000") <-- not working
{
dtTmpTable.Rows["Create Date"] = DBNull.Value;
}
}
dtTmpTable.AcceptChanges();