Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity from multiple tables
Message
From
21/05/2010 13:31:33
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
 
 
To
21/05/2010 13:17:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01465461
Message ID:
01465483
Views:
33
hmmm... this is generating even more errors pertaining to the lack of a DataSource element. I wonder if this an issue of WPF versus Windows forms? I don't remember if I mentioned it, but I am working in WPF. I have been populating WPF datagrids with the ItemSource property, and have never dealt with a datasource property.

Is this still an easy thing to do in WPF?

I think I only need to solve a cast problem (from a dataset to a bindinglist).

???




>Set the DataSource property to the DataSet.
>
>DataSet dsClientReview = this.ClientReviewController.GetClientReveiwList(e.SearchString);
>this.grdMainDataGrid.DataSource = dsClientReview;
>this.grdMainDataGrid.DataBind();
>
>Tim
>
>>Hi Tim,
>>
>>OK... Thanks. Sounds like the way to go. But when I do, the compiler complains that it cannot implicitly convert my dataset to a binding list.
>>
>>I've created the dataset...
>>
>> public DataSet GetClientReviewList(string clientName)
>> {
>> return this.GetDataSet("ClientReviewList", this.CreateParameter("@Name", clientName));
>> }
>>
>>And this is what chokes...
>>
>> this.grdMainDataGrid.ItemsSource = this.ClientReviewController.GetClientReviewList(e.SearchString);
>>
>>How do I cast a dataset to a binding list?
>>
>>Guy
>>
>>
>>
>>
>>
>>
>>>Hi Guy,
>>>
>>>Since this is for lookup purpose and not using for updates I would just create your stored procedure to return what you want and then in your business object you can return a DataSet rather than an entity list and calling that stored procedure. This way you join whatever you want from your tables.
>>>Tim
>>>
>>>>Hi,
>>>>
>>>>Using MM.NET 4.0, classic entities (not Entity Framework).
>>>>
>>>>Here is the problem I'm trying to solve... I want a lookup list for some objects in a child table, but I want a field from the parent table to display in the list. The best example I can think of is a customer with invoices. (That's not what I'm really working with but this simple example will do.)
>>>>
>>>>Imagine a customer table (custPK, custName, blah, blah, blah)
>>>>And an invoice table (invPK, custFK, item, Qty, Amt)
>>>>
>>>>I want an entity list of invoices (for look up purposes only) that contains:
>>>> ( invPK, custName, Item, Qty, Amt )
>>>>
>>>>Note the custName field comes from another table other than the primary entity.
>>>>
>>>>I have been using mmBindingList for creating lookups and lists of single-table entities and this has worked well.
>>>>
>>>>But how do I grab a field from another table? I tried to use the BLG to create a new entity for this purpose but unless I'm missing something, it can only create custom entities from a single table.
>>>>
>>>>Any ideas?
>>>>
>>>>Thanks,
>>>>Guy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform