Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSet, DataTable, DataView
Message
De
29/07/2004 16:23:35
 
 
À
29/07/2004 16:14:28
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00928619
Message ID:
00929338
Vues:
22
Thanks (slaps forehead repeatedly). Blame it on rapid typing and an empty stomach.

So in this case, it's not necessary to instantiate the object with a new()...

Once more, with feeling...


1) the class
using System;
using System.Data;

public class MyLocalData
{
	private static DataTable _DtCustomers;
	public static DataTable DtCustomers
	{
		get {return _DtCustomers ;}
		set {_DtCustomers = value;}
	}

       // if you need to utilize a binding manager, or other data, you could add it here
}
2) first form
MyLocalData.DtCustomers = oBusinessLayer.RetrieveCustomers();
DataRow Dr = MyLocalData.DtCustomers.NewRow();
Dr["FirstName"] = "JOHN";
MyLocalData.DtCustomers.Rows.Add(Dr);
3) second form
dataGrid1.DataSource = MyLocalData.DtCustomers;
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform