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