Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Access
Message
From
26/04/2004 09:45:54
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00898125
Message ID:
00898147
Views:
12
John,

You need to make the DataSet Cattleds static in your DataAccessXML. That way, once it's loaded, it can be accessed from anywhere else in your app. Something like this:
public class DataAccessXml
{
    public static DataSet Cattleds ;

    public void Createcattleds ;
    {
        this.Cattleds = new DataSet() ;
        this.Cattleds.ReadXml("\\Program Files\\Mobile\\Cattle.xml") ;
    }
}
Then, populate the DataSet in your main form the same as you have already done. But now when you need to access the DataSet, since it is static all you need to do is:
private DataTable CattleDt

// You can comment out this line, you won't need it.
//DataAccessXml CattleClass = new DataAccessXml() ;

this.CattleDt = CattleClass.Cattleds.Tables[0] ;

this.dataGrid1.DataSource = this.CattleDt ;
this.dataGrid1.Refresh() ;
~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform