Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem: Showing data from multiple source-tables in a g
Message
From
27/07/2004 16:28:34
 
 
To
23/07/2004 06:33:18
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00920676
Message ID:
00928465
Views:
31
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
Previous
Reply
Map
View

Click here to load this message in the networking platform