Databound Combobox is giving me empty fields?
I've got a vb.net ComboBox that is databound to a table in an Oracle
database. The oracle database fills a dataset that is defined in my
solution. I have a few comboboxes in one of my views that are databound to
seperate datasets. They all work correctly except for one. One of them
brings back 80 rows of data as expected, but there is no text in the
combobox. So you are just searching through 80 rows of nothing. Here's the
code:
Dim dsLegalEntity As New DataSet
Dim dsTaxCertification As New DataSet
Dim dsStates As New DataSet
Dim mdataviewLegalEntity As New DataView
Dim mdataviewTaxCertification As New DataView
Dim mdataviewStates As New DataView
Try
dsLegalEntity = My.WebServices.Service.GetLegalEntities()
mdataviewLegalEntity = New
DataView(dsLegalEntity.Tables("AS_LEGAL_ENTITIES"))
dsTaxCertification = My.WebServices.Service.GetTaxCertCodes
mdataviewTaxCertification = New
DataView(dsTaxCertification.Tables("TAX_CERT_CODE"))
dsStates = My.WebServices.Service.GetVendorStates
mdataviewStates = New DataView(dsStates.Tables("VENDOR_STATES"))
With comboLegalEntity
.DataSource = mdataviewLegalEntity
.ValueMember = "LEGAL_ENTITY"
.DisplayMember = "LEGAL_ENTITY"
End With
With comboTaxCertification
.DataSource = mdataviewTaxCertification
.ValueMember = "TAX_CERT_CODE"
.DisplayMember = "TAX_CERT_CODE_DESCR"
End With
With comboState
.DataSource = mdataviewStates
.ValueMember = "STATE"
.DisplayMember = "STATE"
End With
comboPurchSale.SelectedIndex = 0
Catch ex As Exception
AppError.InsertAppError(ex.ToString(), "btnQSearch_Click",
"Default.aspx", "")
End Try
The combobox that is the problem is the "comboState" one. The dataset
table name is called "VENDOR_STATES" and the column it points to is called
"STATE". As far as I can tell, I have my names right, so I don't
understand why this one won't work correctly while the others work fine.
Thanks in advance for the help.
No comments:
Post a Comment