15
Reply

Datatable cell to list & using string list in Legends

Farhan Shariff

Farhan Shariff

10 years ago
1.8k
I am comparing values in datatable column , I want to store the
string in  table7.Rows[yy]["Die_ID"] in to a string array.how to solve this


string[] a = null;

  if(table7.Columns.Contains(colx))
                       {
                           for (int yy=0; yy<table7.Rows.Count; yy++)
                           {
                               
                                double tval = double.Parse(table7.Rows[yy][colx].ToString());


                                   if (tval < lower || tval > upper)
                                   {
                                     a[yy] = table7.Rows[yy]["Die_ID"].ToString();
 //Error I want to store the string values in a string array :Object reference not set to an //instance of an object.
                                     
                                   }
                               
                           }

         
                                     
  }


Answers (15)