Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem: Showing data from multiple source-tables in a g
Message
De
27/07/2004 16:28:34
 
 
À
23/07/2004 06:33:18
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00920676
Message ID:
00928465
Vues:
33
I am pretty much a beginner at this myself but I have made a similar attempt with my application.

In my example, I only update a single table while viewing two. This way the grid is really only bound to a single business object; the details of the grid and not the extra stuff. For example customers and their transactions, the transactions are the items I want to update.

The business object needs to be set up to allow for querying with both tables; customers and transactions.
public DataSet GetAll()
{
	string Sql = "";

	Sql = "SELECT a.TransactionID, a.TransactionInfo, a.TransactionPrice, b.CustomerName " +
		"FROM Transaction a LEFT OUTER JOIN Customer b " +
		"ON a.CustomerID = b.CustomerID " +
		"ORDER BY 1, 2, 3";

	return this.GetAll(Sql);
}
At the same time the Transaction BusinessObject needs some more initialization statements:
public class Transaction : ABusinessObject
{
	public WaitingFacility()
	{
		this.UpdateSelectStatement = "SELECT * FROM Transaction";
		this.TableName = "Transaction";
		this.PrimaryKey = "TransactionID";
	}

...
Of course this would only allow you to update a single table. This is the best I can supply given my limited knowledge.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform