removing null valued columns from dataset in asp .net

Posted by N.Sai Harish on Stack Overflow See other posts from Stack Overflow or by N.Sai Harish
Published on 2010-01-19T05:19:39Z Indexed on 2010/04/03 8:03 UTC
Read the original article Hit count: 221

Filed under:

I have a table which stores data with null valued columns for some entries .I want to retrieve only Not null data to the detail view. I tried the following

foreach(string strTableField in (objDataSet.Tables[0].Columns[i])) 
{
    if(objDataSet.Tables[0].Columns[i].Equals(null))
    {
        objDataSet.Tables[0].Columns.Remove(strTableField);
       objDataSet.Tables[0].AcceptChanges();
    }

    i++;
}

but it is giving error .. Pls help me reg this ...

© Stack Overflow or respective owner

Related posts about dataset