Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shaped Entities
Message
From
23/12/2008 13:04:35
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
23/12/2008 08:55:13
Tegron Tegron
Platinum Technologies
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01368835
Message ID:
01369431
Views:
16
Tegron,

>Hey Tim thanks for the response. I was trying to avoid having two business objects that basically served the same purpose.
>
>I guess to answer your question, I was trying to be able to instantiate and use one business object to maintain and display data in grids that only needed to display data without editing or deleting. I am using the Infragistics grid. I decided to just use a sqldatasource, but I am sort of anal and I like keeping data access standardized throughout the app.
>
>I was eventually able to do what was in the documentation about shaped entities, but as of yesterday I was still trying to get the data to appear in my grid through binding.

For display purposes like a grid or something you don't even have to use entities. You could just bind to a dataset but you don't have to use a SqlDataSource to do that. Just use your existing business object class but return a dataset like this.
public DataSet GetCustomerListForDisplay(string custState)
{
     DataSet dsCustomerList;
     dsCustomerList = this.GetDataSet("SELECT * FROM Customer c, PhoneNumbers p WHERE c.CustomerID = p.CustomerID AND
                         c.State = @CustState", this.CreateParameter("@CustState", custState));

     if (dsCustomerList == null)
          dsCustomerList = this.GetEmptyDataSet();

     return dsCustomerList;
}
You can of course use a stored Procedure as well, but the point is you can get data with a join in it like this in your business object and return an DataSet. This works great for displaying in a grid or something like this although you loose the typed entity.

Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform