RichW
asked on
Databinding a Combobox
Hi All
I have a fairly simple thing I'm trying to do but for the life of me I cannot figure out why it's not working.
Working with VB.Net 1.0, Oracle 9i.
I have a stored procedure I'm calling to fill a dataset and then I want to bind the dataset to a Combobox.
Here's my code:
Dim ds As DataSet
DB.OracleDataManager.AddCo mmandParam eter("p_rc out", ParameterDirection.Output, Oracle.DataAccess.Client.O racleDbTyp e.RefCurso r, , True)
ds = DB.OracleDataManager.GetDa taSet("BIS SETUP.SP_G ET_ALL_CUS TOMERS", CommandType.StoredProcedur e, True, "Customers")
With cboCustomer
.DisplayMember = "Cust_Name_Num"
.ValueMember = "IND_CUSTOMER"
.DataSource = ds.Tables("Customers")
End With
The DisplayMember and ValueMember names are absolutely correct from the stored procedure.
When I run the form I get the value "System.Data.DataRowView" repeatedly in the combobox.
If I switch around the combobox settings, like move .DataSource = ds.Tables("Customers")
above the other two lines, the ValueMember field fills the combobox!
Can anyone tell me what I'm doing wrong?
Thanks
RichW
I have a fairly simple thing I'm trying to do but for the life of me I cannot figure out why it's not working.
Working with VB.Net 1.0, Oracle 9i.
I have a stored procedure I'm calling to fill a dataset and then I want to bind the dataset to a Combobox.
Here's my code:
Dim ds As DataSet
DB.OracleDataManager.AddCo
ds = DB.OracleDataManager.GetDa
With cboCustomer
.DisplayMember = "Cust_Name_Num"
.ValueMember = "IND_CUSTOMER"
.DataSource = ds.Tables("Customers")
End With
The DisplayMember and ValueMember names are absolutely correct from the stored procedure.
When I run the form I get the value "System.Data.DataRowView" repeatedly in the combobox.
If I switch around the combobox settings, like move .DataSource = ds.Tables("Customers")
above the other two lines, the ValueMember field fills the combobox!
Can anyone tell me what I'm doing wrong?
Thanks
RichW
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I went back to the form code and forced the text to all upper case and it worked.
Thanks for your help!
RichW