c# - Getting value from a DataSet into a variable -
I have the following method that returns the dataset. I am using .NET 2.0
DataSet ds = GetAllRecords (); I want to get value from each column for a particular line and paste it in one variable. How can this be achieved?
Currently the row returns all the rows from the table and I want to get a special line based on that ID.
However, if this is not possible I can come with
Dataset DS = GetSpecificRecord (ID); But I still need to get the values from each column and bind it into the variable. Please advise.
// Create a table of data table table = new datatable ("user"); Table Columns Add (new datacel ("id", typef (int)); Table Column.ed (new datacimal ("name", typef (string)); Table. Ro Add (1, "ABC"); Table. Ro Add (2, "Deed"); Table. road. Add (3, "FFF"); Table. Ro Add (4, "HHH D"); Table. road. Add (5, "HKF DS"); // Search for a given ID, for example 1 Detroit [] Results = Table. Select ("id = 1"); // This data will return a line for foreign currency (in the Datovir Row result) {Console.WriteLine ("{0}, {1}", row [0], row [1]); }
Comments
Post a Comment