Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with combobox

Status
Not open for further replies.

krill

Programmer
Jan 16, 2001
38
AU
Getting the folowing error when loading a pocket PC form...

Error:
"DataRowView to type String is not valid"

Code:
Dim xtrXML As New XmlTextReader(FsXML)
statesDS.ReadXml(xtrXML)
xtrXML.Close()
FsXML.Close()

' Get a DataTable to conveniently use for binding.
Dim dt As DataTable = statesDS.Tables("ListStop")
Try

'Bind the combobox
cboStops.DataSource = dt
cboStops.ValueMember = "StopID"
cboStops.DisplayMember = "StopDes"

Source:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata" xmlns:xsi=" xsi:noNamespaceSchemaLocation="ListStop.xsd">
<ListStop>
<StopID>1</StopID>
<StopDes>Forest Lake Shops</StopDes>
</ListStop>
<ListStop>
<StopID>2</StopID>
<StopDes>Grand Ave Forest Lake</StopDes>
</ListStop>
</dataroot>

Any ideas?????
 
where do you get the error (when) and are there any records in the datatable when you debug it.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
At present I can't debug uisng the emulator...I can only run it in "start without debugging" ...I believe that I may need to re-install...the error occurs as soon as it hits

cboStops.ValueMember = "StopID"

I making an assumption that there is data...if I comment this line out the code works and I have descriptions showing in the drop down list. All I'm trying to do is get an underlining code to use else where in the app not the description.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top