Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to clear a combobox?
Message
From
08/05/2004 04:18:02
 
 
To
07/05/2004 19:01:42
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00898211
Message ID:
00902154
Views:
55
You are right, more questions. But I'm afraid they've reach a broad area. Kind of like a stream that suddenly opens into a vast ocean. :)

I've heard talk of BindingContexts and DataBindings in discussions in the newsgroups (I search them ALOT), and on every .NET forum I've been on. I know enough about ADO.NET to be able to run SQL commands against a database (be it Jet, VFP, or SQL) using connections, commands, dataadapters and datasets to get the data, and do simple binding to a datagrid to display/edit the data. That's about the extent of my experience with ADO.NET. I really need to dedicate some serious time to studying ADO.NET in more depth. If you care to take the time to explain BindingContexts, go for it. I'll read anything you have to say about it like a kid in a candy shop. ;)

If you can, point me to some good ADO.NET primers, articles, etc. that would have good explanations about all the different ways/methods to do data binding (both for getting data into controls, and for getting data from the controls into a datasource). So many of the ones I've run across just explain about connectionstrings, connections, dataadapters, datasets, and how to use the .DataSource property. No real good explaination of databinding beyond that.

Thanks for all the info you've given me, and for any further info/pointers/leads you give me. :)

-----
Lee Perkins

>Lee,
>
>Don't you just love it when you finally have that "ah hah!" moment? <s>
>
>>How does it know what record in the .DataBindings datasource to "attach" to?
>
>That all depends on the row you're "on" in the table, which is determined by the BindingContext's .Position property. (I see more questions coming ... <g>)
>
>~~Bonnie
>
>
>
>>Bonnie,
>>
>>Argh!! Where are my shade?!?! The light just came on so bright I'm almost blind! LOL! :)
>>
>>I get it now. I've just been using ComboBox's to let the user select something and I performed an action on that selection. So the DataSource, DisplayMember, and ValueMember properties attach specific properties of the ComboBox to a datasource for data to flow from the datasource to the ComboBox. The .DataBindings property used to attach properties on the ComboBox to a datasource for data to flow from the ComboBox to the datasource. I'll have to look into that. How does it know what record in the .DataBindings datasource to "attach" to?
>>
>>-----
>>Lee Perkins
>>
>>>Lee,
>>>
>>>> ComboBox.SelectedText has the data from the DisplayMember field and ComboBox.SelectedValue has the associated data from the ValueMember field
>>>
>>>Yep, that's what happens. But that only does you any good if you then *do* something with those. That's where DataBinding comes in.
>>>
>>>Does .DataBindings do something in addition to this? I'm confused on what exactly .DataBindings do
>>>
>>>Say you have a form where you edit data from a table. One column in your table can be one of several different codes. Here's where you would use a Combo to represent that column in your table. The Combo's DataSource would be a different table (a code table) containing all the possible codes for that particular column in your main table. When you choose an item from that Combo, it won't automatically get saved to the column in your main table unless you DataBind it. If you don't DataBind it, you would have to manually set the value of the column in your main table (in either the Combo's SelectedValueChanged, SelectedIndexChanged or Validated event handlers). By DataBinding to the column, it's all done automatically ... which is obviously the preferred way of doing things.
>>>
>>>~~Bonnie
-----
Lee Perkins
TigerBase Technologies

"Lee is one that would plug his brain into the internet, if he could, and STILL scream for more" - Very good friend of Lee's
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform