troubleshooting Question

Databinding a Combobox

Avatar of RichW
RichWFlag for United States of America asked on
Visual Basic.NET
2 Comments1 Solution362 ViewsLast Modified:
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
nekkantisurendra
Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros