Working with rows in a dataset

  • Thread starter Thread starter jed
  • Start date Start date
J

jed

public Form1()
{
InitializeComponent();
string xml = "C:\\WirelessXML.xml";

dataSet1.ReadXml(xml);
}

private void button1_Click(object sender, EventArgs e)
{
dataGridView1.DataSource = dataSet1;
dataGridView1.DataMember = "Value";
foreach (DataRow dr in dataSet1.Tables[0].Rows)
{

}
I want to access each row and work with each one one by one how is the
best way for me to do this I want to take each row give it date and
multiply values in a certain column by a fixed value then save them
back to a typed dataset
 
Is dataSet1 a typed data set already? If so, then cycling through the
rows using a loop (like the one you have) should be just fine. You just
have to set the values of the columns you want. You should also be able to
cast each DataRow to the typed version to make working with it easier.
 
Back
Top