how to check if a column in a dataset contains a particular value or not ? RRS feed

  • Question

  • hi
    i have a dataset having some values in two columns(KEYWORDS, keycount)
    can any one tell that how i can check in the column "KEYWORDS " if it contains a certain string or not .
    thanks in advance
    Friday, June 19, 2009 9:11 AM


  • Try this code

                DataRow dr = ds.Tables[0].Rows[0];
                string keywordValue = dr["KEYWORDS"];
                if (keywordValue.Trim == "")
                    MessageBox.Show("Data doesn't Exists");
                    MessageBox.Show("Data Exists");
    This forum is for networking questions. You should ask such questions in VC# General Forums
    Gaurav Khanna
    Friday, June 19, 2009 12:24 PM