Y
Young J. Putt
I have what I thought was a relatively simple data situation that I can't
seem to get working using ADO.NET datasets and data binding.
I have an "Issues" table which records the UserID of the user that opens,
closes and is assigned to the Issue. These come from the same group of
users, so they are all related to a "Users" table. I have three combo boxes
on a form. I set up the binding as shown below. It works when the form is
loaded, but when I change one of the combo boxes, they all change. Based on
what I've read, I believe I need a different BindingManagerBase for each
combo box, but I've been unable to find an example of how to actually do
this. Can anyone help?
'Closed By
cboClosedBy.DataSource = dsAppData.Tables("Users")
cboClosedBy.DisplayMember = "UserName"
cboClosedBy.ValueMember = "UserID"
cboClosedBy.DataBindings.Add("SelectedValue", dvIssue, "ClosedBy")
'Opened By
cboOpendBy.DataSource = dsAppData.Tables("Users")
cboOpendBy.DisplayMember = "UserName"
cboOpendBy.ValueMember = "UserID"
cboOpendBy.DataBindings.Add("SelectedValue", dvIssue, "OpenedBy")
'Assigned To
cboAssignedTo.DataSource = dsAppData.Tables("Users")
cboAssignedTo.DisplayMember = "UserName"
cboAssignedTo.ValueMember = "UserID"
cboAssignedTo.DataBindings.Add("SelectedValue", dvIssue, "AssignedTo")
seem to get working using ADO.NET datasets and data binding.
I have an "Issues" table which records the UserID of the user that opens,
closes and is assigned to the Issue. These come from the same group of
users, so they are all related to a "Users" table. I have three combo boxes
on a form. I set up the binding as shown below. It works when the form is
loaded, but when I change one of the combo boxes, they all change. Based on
what I've read, I believe I need a different BindingManagerBase for each
combo box, but I've been unable to find an example of how to actually do
this. Can anyone help?
'Closed By
cboClosedBy.DataSource = dsAppData.Tables("Users")
cboClosedBy.DisplayMember = "UserName"
cboClosedBy.ValueMember = "UserID"
cboClosedBy.DataBindings.Add("SelectedValue", dvIssue, "ClosedBy")
'Opened By
cboOpendBy.DataSource = dsAppData.Tables("Users")
cboOpendBy.DisplayMember = "UserName"
cboOpendBy.ValueMember = "UserID"
cboOpendBy.DataBindings.Add("SelectedValue", dvIssue, "OpenedBy")
'Assigned To
cboAssignedTo.DataSource = dsAppData.Tables("Users")
cboAssignedTo.DisplayMember = "UserName"
cboAssignedTo.ValueMember = "UserID"
cboAssignedTo.DataBindings.Add("SelectedValue", dvIssue, "AssignedTo")