Results 1 to 2 of 2

Thread: [RESOLVED] [2.0] questions about currencyManger/bindingSource

  1. #1

    Thread Starter
    Hyperactive Member r0k3t's Avatar
    Join Date
    Dec 2005
    Location
    Cleveland
    Posts
    361

    Resolved [RESOLVED] [2.0] questions about currencyManger/bindingSource

    howdy!

    Recently I was enlightened to the bindingSource class. I was doing some reading and some testing and I have a couple of questions.

    by creating a bindingSource it automatically creates a CurrencyManager right? I am pretty sure about that fact however from what I can infer about what a CurrencyManager does wouldn't a dataGridVIew need to create one of these by default?

    Also - If I create a bindingSource, set the dataSource and then set the datagridview datasource to the bindingSource, they somehow must share the same CurrencyManager, right?

    Like this
    vb Code:
    1. bs = new BindingSource();
    2. bs.DataSource = ds.Tables[0];
    3. dgSearchResults.DataSource = bs;

    Also - I have done some reading on this subject but some of it was a little fuzzy - anyone have a good suggestion for further reading?

    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] questions about currencyManger/bindingSource

    Before the BindingSource you would bind a list directly to a control and then you'd have to access the CurrencyManager directly to manipulate the data through the binding. It was a pain. The BindingSource is basically just a wrapper for that CurrencyManager, providing a consistent, user-friendly interface to manipulating the data through the binding. You should be able to almost all of what you need as far as bound data manipulation via the BindingSource, without ever having to touch any controls, data sources or CurrencyManagers directly.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width