473,375 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,375 software developers and data experts.

Very odd Databinding behaviour

I have a ComboBox and a TextBox bound to a Dataset/datatable returned from a
SQL Database. The databinding is set in Design Mode.

Everything works fine on my initial fill, and I get the correct list of
items in the combobox, and the textbox which is bound to a second column in
the same table, changes to the appropriate value when a new item is selected
in the ComboBox. The ComboBox is displaying a list of products, and the
texbox the number remaining in inventory.

However, as the program is used, I need to refill the Dataset to reflect any
changes in product availability, or # of products remaining in inventory. I
Clear the Dataset, set my select command parameters, and refill the dataset.
(The actual code is identical to the code used to fill it in initially).

Now, the ComboBox shows the first item in the list as the selected text,
clicking the dropdown shows me the correct list of products, however I
cannot select a new item from the list. Regardless of what I do, the
SelectedText is reset to the first item in the list. In addition, the
TextBox supposed to show inventory quantity, is now blank (no value).

I hope someone has some idea what might be happening here, I can't seem to
figure out what the problem is.

Thanks,

Code used to fill Dataset.
Try
Me.DsRenewProductList1.Clear()
Me.daProductList.SelectCommand.Parameters.Item("@D istributorID").Value =
appSettings.DistributorID
Me.daProductList.Fill(Me.DsRenewProductList1, "cw_authproductselect")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "SQL Error updating Product
List")
Return False
End Try

The ComboBox databinding:
Tag: DsRenewProductList1 - cw_authproductselect.SKU
Text: DsRenewProductList1 - cw_authproductselect.ProductName
DataSource: DsRenewProductList1
DisplayMember: cw_authproductselect.ProductName
ValueMember: cw_authproductselect.ProductName

TextBox databinding:
Text: DsRenewProductList1 - cw_authproductselect.authCount

Nov 21 '05 #1
0 964

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff | last post by:
I am having a behaviour problem with Databinding on a C# WinForm. I have three textboxes and a Checkbox bound to a dataset. The desired behaviour is when I check/uncheck the checkbox, I want to...
9
by: Marina | last post by:
Here is the problem. If 2 different properties on the same (or different) control are bound to the same data column, changing the Text property and calling EndCurrentEdit discards the new value. ...
3
by: DraguVaso | last post by:
Hi, I'm having the following situation: - A class clsFournisseur with public property's which raise a MyPropertyChanged-event in the Set-method for each Property. Public Event NomChanged As...
0
by: Uchiha Jax | last post by:
When using a strongly typed dataset (generated from the Visual Studio IDE from an XSD file) and databinding I get a really odd error when binding to both a combox and a datetimepicker. I bind...
3
by: Kevin Swanson | last post by:
I'm writing what should be a very simple app against an Oracle database. The app has a number of user controls, any one of which is loaded into a main display page using the loadControl method,...
7
by: Justin Hoffman | last post by:
I am new to vb.net programming and am just exploring the way databinding works with Windows forms and am having trouble with some fairly basic customization of data entry. The form uses the...
3
by: Alec MacLean | last post by:
Hi everyone, I have a ComboBox that when changed, calls a method to change the content of a ListBox. I'm also using the Listbox's SelectedIndexChanged event to change other control values on...
5
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
7
by: JTC^..^ | last post by:
When i attempt to bind to the "Text" and "Value" property of a combobox on a windows form the value is reset when I leave the combobox. The comboboxes contain the correct Text and Values. I know...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.