Link to home
Start Free TrialLog in
Avatar of RichW
RichWFlag 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
ASKER CERTIFIED SOLUTION
Avatar of nekkantisurendra
nekkantisurendra
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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