Working with rows in a dataset

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top