Hi
Thanks. No luck I am afraid. I have tried all this;
Dim dv As New DataView(ds.Clients)
1. Me.txtParent.DataSource = "dv.company"
2. Me.txtParent.DataSource = dv
Me.txtParent.DataMember = "company"
3. Me.txtParent.DataSource = ds.Clients
Me.txtParent.DataMember = "company"
Any ideas? I have tested ds.Clients.Count and it returns more than zero so
there are records in the dataset.
Thanks
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE**************@TK2MSFTNGP06.phx.gbl...
"John" <Jo**@nospam.infovis.co.ukschrieb:
>I am using below code to fill the drop down list of a combo box from a
table in the dataset;
Dim dv As New DataView(ds.Companies)
Me.txtParent.DataSource = dv
Me.txtParent.DataMember = "Company"
dv.Dispose()
dv = Nothing
Unfortunately no data turns up in combo box. What am I doing wrong?
Remove the last two lines. You must not destroy the data source as long
as the control depends on it. In addition, setting local variables to
'Nothing' is (with very few exception) not the best style.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>