If it's not then you can call the Reset Bindings method of the associated Binding Source. oh and this is a sqlexpress 2005 mdf that has the table with the data in it if that makes any difference...
I think you need to explain more clearly exactly what you're trying to do, how you're trying to do it, what you expect to happen and what does happen. the short version (or at least as short as I can make it, so forgive the excessive verbiage) is as follows: - created a sql2005 express database with a table called currency in it - fields are Currency, Rate, As_of - i call a public function named getexchangerate() that hits yahoo finance and grabs the exchange rate file for that particular currency and time of day and parses the values in to their respective pieces that correspond with the above fields in currency - i fire up a connection to the database and call the transact-sql update command using the values retrieved above - the table updates with the values successfully - i launch form1 which contains a combobx entitled Exchange_CB - it's display value is Currency, It's value item is Rate - also, as a sidebar....i have a string i pass from the getexchangerate function that updates a label that contains all of the retrieved values - this also works correctly on form load (and is how i discovered the update wasn't happening on the comboboxes selectedvalue) - when i dropdown and change the combobox, in this case from CDN to USD, the previous valuemember is displayed (ie from the last successful download) - i exit the app and go back in, and change it again and it's correct. A Data Set has a Tables property, which is a collection of Data Tables, and a Relations property, which is a collection of Data Relations.
Logic seems to tell me that my call to refresh the data is happening before the adapter is filled, but of course i don't know at this point and hence this posting.... When you call Fill on a Data Adapter or Table Adapter you are populating a Data Table.
You wouldn't use the Data Bindings property at all.
That's for bind specific properties of the Combo Box to values from a list or an object.
That is used more in situations like binding the Text property of a Text Box.
For a Combo Box you would use, as you said, the Data Source, Display Member and Value Member.
- oh and lastly, the "why" i'm doing it this way - I'm doing this because the machine that this app is running on is sometimes online and sometimes not and the exchange rate is used in a calc for quotes, hence i want both the end user to actually see what the exchange rate WAS before they went offline or to see what it IS if they are, and also to store it. hope this helps anybody else who has stumbled upon the same issue. There is a difference between a dataset and the database. If you update the data in the Database's datatable you have to reload the data into the dataset datatable. Even if you pass a Data Set as an argument, you are saving changes from one of the Data Tables in its Tables collection. Update(Pro Flow1Data Set) End Sub Form 1 has the combobox that is not updating.
I can equate this issue to the following example: "on Form A a user has a combobox called customers and a button called add customer. Resume Binding() 'Set the new item as the selected item combobox. Also, if you update the data in a dataset, you have to save it using the update method. Just as a database table has columns to describe the data and rows to contain it, so a Data Table has a Columns property, which is a collection of Data Columns, and a Rows property, which is a collection of Data Rows. You can manipulate the dataset without committing the changes to the actual database. [combobox] datasource = Proflow1Dat Set Binding Source Display member = name Bindingsource [underneath the form] = Bindingsource = Proflow1Dat Set Binding Source [Proflow1Dat Set Binding Source] Datasource = Pro Flow1Data Set Datamember = orificedata Form1 load code You don't have a problem at all.
That way the user sees a list of names they can choose and you can get the ID that corresponds to the selected name from the Selected Value property. A Data Set has a Tables property, which is a collection of Data Tables, and a Relations property, which is a collection of Data Relations.
Now, in your situation, you should be binding your Data Table to a Binding Source and then binding that to the Combo Box. When you call Fill on a Data Adapter or Table Adapter you are populating a Data Table.
It can be done in code or, if you added the Data Set in the designer, then it can also be done in the designer. Even if you pass a Data Set as an argument, you are populating one of the Data Tables in its Tables collection.