Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSet and combobox help.
Message
From
24/10/2007 15:04:37
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
24/10/2007 12:02:41
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01263159
Message ID:
01263295
Views:
13
Hi Matt,

I assume you are using a DataSet by choice as opposed to using an EntityList.

With a datagrid there is a BindingSourceType property that would need to be set to "Data" for DataSets. I don't see that with a comboBox. I wonder if you need to be setting the DataSource and DisplayMember rather than the BindingSource and BindingSourceDisplayMember properties.

All that said, if you do away with the dataset and just bind directly to the Business Object you won't have this issue.

Tim

>I've playing with pulling a dataset from a BO and trying to display the results in a combobox.
>
>Here is my dataset method in my BO:
> public DataSet CustomersWithActiveJobs()
> {
> return this.GetDataSet("CustWithActiveJobs");
> }
>
>
>The SQL in the stored proc "CustWithActiveJobs" is:
>
> SELECT distinct cust_num
> from Job_Info
> where Job_Info.status='A'
>
>That all work fine.
>
>
>My problem is that now I don't know what to set the DataSource, DisplayMember, and ValueMember of the mmComboBox to? I have tried all kinds of things, but nothing has made it work. Also, I don't know if they are supposed to be enclosed in quotes, or not.
>
>
>Here is how I am trying to link my combobox to the dataset:
>
> public DataSet dsCustWithActiveJobs;
>
> public BusinessForm1()
> {
> this.oCustomers=(Customer) this.RegisterBizObj(new Customer());
>
> dsCustWithActiveJobs = this.oCustomers.CustomersWithActiveJobs();
>
> InitializeComponent();
>
> this.mmComboBox1.DataSource = dsCustWithActiveJobs;
> this.mmComboBox1.DisplayMember = ??????????;
> this.mmDataGridView2.ValueMember = ??????????;
> }
>
>It seem like a table name is required, but do I reference the SQL table or what?
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform