Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSet and combobox help.
Message
From
24/10/2007 17:08:24
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
24/10/2007 15:54:55
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01263159
Message ID:
01263348
Views:
17
Ah, I see the delima. I didn't realize the two questions were related. I needed to do the same thing and also used dataSets for that. Below is what I did but put them in a DataGridView. I think in an earlier post Kevin eluded to using Entities this way but I never could figure it out.
Tim

>>All that said, if you do away with the dataset and just bind directly to the Business Object you won't have this issue.
>
>My confusion with using a BO is that I cannot yet figure out how to have one control on my form display one set of data from a BO, (i.e. a stored proc result), while having another control on the form that uses the same BO, but displays a different data result set. From my first testing, it seems that when you fire a BO call, all controls that are bound to that BO will update to the same exact data set.
>
>Imagine one combobox displaying active customers (cust_status="A"), and another combobox displaying inactive customers (cust_status="I").
>
>How would you structure this using a BO model? I'm wanting to learn the BO stuff, but I do not yet grasp some of the fundamentals like this.
>
>That's why I thought DataSets might be the answer, but maybe not.
>
>i.e.
>
>dsActiveCustomers=BO.GetActiveCustomers();
this.oItems = (DisplayItems)RegisterBizObj(new DisplayItems());

// Get News Items
this.dsNews = this.oItems.GetItemsDataSetByType(DisplayItemType.News, false, "News");
if (this.dsNews.Tables[0].Rows.Count > 0)
{
     this.grdNews.DataSource = dsNews;
     this.grdNews.DataBind();
}
else
     this.lblNews.Visible = false;

// Get Event Items
this.dsEvents = this.oItems.GetItemsDataSetByType(DisplayItemType.Events, false, "Events");
if (this.dsEvents.Tables[0].Rows.Count > 0)
{
     this.grdEvents.DataSource = dsEvents;
     this.grdEvents.DataBind();
}
else
     this.lblEvents.Visible = false;
>dsInactiveCustomers=BO.GetInactiveCustomers();
>
>then bind each ds to it's combobox?
>
>Also, for now, I am not so much wanting to BIND for CRUD purposes, I just want to use the combboxes to get user choices, and the run SQL statements to pull back and display static data based on what they choose.
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform