Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Access
Message
 
 
À
26/04/2004 09:45:54
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00898125
Message ID:
00898163
Vues:
13
Thanks Bonnie

Easy when you know how.

John


>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform