question about datasets that get empty

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,

When I click on Button1 than I load an xml file in a dataset.
The dataset table contains 5 rows

When I click on Button2 I want to write the dataset back to xml.
But it contains no data.
The error is that table[0] is null

What is the cause and hwo can I work arround it?

Thanks a lot,

Filip

private void Button1_Click(object sender, System.EventArgs e)
{
AdressenDataSet.ReadXml("c:\\Lessius\\adressen.xml");
int i = AdressenDataSet.Tables[0].Rows.Count;
}

private void Button2_Click(object sender, System.EventArgs e)
{
int i = AdressenDataSet.Tables[0].Rows.Count;
AdressenDataSet.WriteXml("c:\\Lessius\\adressen.xml");
}
 
Is this an ASP.NET application? Can you please provide some more
information, perhaps some code.
 
Without seeing more, I would guess that your dataset is going out of scope
when you click button 2.
 
Back
Top