Detrmining if a colum exsits in a dataset
Posted on 2005-04-08
I have a column that I add to an exisiting dataset. I want to add this column the first time it loops through this code, but ignore the column add on subsequent trips through the loop.
Currently I have the following code
if (dsPayCheck.Tables["PayCheckComponents"].Columns["key"] == null)
This stops the unhandled exception if the column does not exsit the first time, but it still steps into the if statement if it's a return trip to the loop.
What am I doing wrong?