My question came from this question
It seems to be actual developing code for a real application. What If your contract says that all code you made for app of your employer is a secret? Isn't it risky to copy code fragments like that online (if you read carefully, it gives information about the database)? Wouldn't it be better to write something like this?
DataTable1 = datatable with a lot of data;
DataTable2 = other datatable with a lot of data;
for (int i = 0; i < DataTable1.Rows.Count; i++)
{
if (DataTable1 ["Field1"]).ToString() != SomeValue) // this statement doesn't work
{
DataRow dr = DataTable2.NewRow();
dr["Field1"] = "";
dr["Field2"] = "*" + DataTable2["Field1"];
Datatable2.Rows.Add(dr);
}
}