Avatar of RichW
RichW
Flag for United States of America 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.AddCommandParameter("p_rcout", ParameterDirection.Output, Oracle.DataAccess.Client.OracleDbType.RefCursor, , True)

            ds = DB.OracleDataManager.GetDataSet("BISSETUP.SP_GET_ALL_CUSTOMERS", CommandType.StoredProcedure, 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
Visual Basic.NET

Avatar of undefined
Last Comment
RichW

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
nekkantisurendra

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RichW

ASKER
nekkantisurendra, I copied the Displaymember text from the procedure exactly how it was typed.  After reading your suggestion I ran the procedure in Oracle and noticed that the mixed-case Displaymember text came out as UPPER CASE in the return.

I went back to the form code and forced the text to all upper case and it worked.

Thanks for your help!

RichW
Your help has saved me hundreds of hours of internet surfing.
fblack61