Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Value of Row in Datatable c#

Tags:

People also ask

What is DataRow C#?

A DataRow represent a row of data in data table. You add data to the data table using DataRow object. A DataRowCollection object represents a collection of data rows of a data table.

How do I check if a DataRow column exists?

You can use the DataColumnCollection of Your datatable to check if the column is in the collection.


i have a problem with my code.

foreach (DataRow dr in dt_pattern.Rows)
    {
      part = dr["patternString"].ToString();
      if (part != vpart)
      {
        System.Console.WriteLine(part);
        System.Console.WriteLine("Geben Sie bitte für den Abschnitt die AT ein: ");
        temp = System.Console.ReadLine();
        AT = ToDouble(temp);
        dr["AT"] = AT;

        double xATmax = ToDouble(dr["Ampl"].ToString());
        double x = ToDouble(dr["Time"].ToString());

        double yATmax = ToDouble(dr["Ampl"]+1.ToString()) + AT;
        double y = ToDouble(dr["Ampl"].ToString());

        dr["alphaATmin"] = Gradient(x,xATmax,y,yATmax);
        System.Console.WriteLine(dr["alphaATmin"]);
      }
      vpart = part;          
    }

but i need at xATmax and yATmax the Value of the next Row... Someone can help me ?