Combobox Seleted item

dashley

Well-known member
Joined
May 27, 2005
Messages
59
Location
Tennessee
Programming Experience
10+
Im using a bound combobox (vb.net 2005 / CF) that pulls data from my db and all works fine. I'm using the canned tableadapter and binding soucr etc..

The user picks an item and its stored in the db by its selectedvalue.

when the client goes back and recalls the record i want the same combobox to show the selected item as the one retrieved from the DB.

I keep getting "System.Data.DataRowView"
when I debug through the comboboxes item.count

VB.NET:
 For X = 0 To Me.CboLoc.Items.Count - 1
            MsgBox(Me.CboLoc.Items.Item(X).ToString)
            If Me.CboLoc.Items.Item(X).ToString = gbl_location.ToString Then
                CboLoc.SelectedIndex = X
                Exit For
            End If
        Next




gbl_location is the value pulled from the db. Its a string representing a hospital name.

I also have available the actual valued stored in the DB which is an iteger and its also the value in the combobox.
 
Back
Top