The code below is giving me an error saying that row 0 does not exist. I
have written the code in VB.NET and it works flawlessly. I am in the
process of converting to C# code. This is supposed to work by assigning
" " where the ADCN field is returned NULL. This SQL server tables
allows for NULLs (completion date, etc...). What am I missing here?
int dsRowCount = ds.Tables[0].Rows.Count;
for (int i=0; i <= dsRowCount; i++)
{
if (ds.Tables[0].Rows[i]["ADCN"] is DBNull)
{ds.Tables[0].Rows[i]["NewADCN"] =
Convert.ToInt32(ds.Tables[0].Rows[i]["ADCN"]);}
else
{ds.Tables[0].Rows[i]["NewADCN"] = " "; }
}
*** Sent via Developersdex http://www.developersdex.com ***