How do i get datareader from web service to pocket pc?

  • Thread starter Thread starter nomenklatura
  • Start date Start date
N

nomenklatura

Hi,
in pocket pc i have a listview control on from..
And i wantto get data from sqlserver and add in listview this data
But i only fill listview with datareader:
While dr.Read()

lviNewItem.Text = dr.GetDateTime(0)

lviNewItem.SubItems.Add(dr.GetString(1))

Me.LWTeshisler.Items.Add(lviNewItem)

End While

so i have a problem , because webservice function return only dataset:

I have a webservice which read data from sqserver ,
<WebMethod()> _

Public Function GetData() As DataSet

...

return ds

end function



there is no problem

on pocket pc:

Dim ws As New webservice.service1

Dim sqlDS As System.Data.DataSet

Dim drTeshis As SqlCeDataReader

sqlDS = ws.GetData

ok.. but i couldn't fill listview this dataset, i necessery to datareader:

how can i convert dataset to datareader?

Or is this solution anyelse?

Thans for advance...
 
The DataSet already has the data, so just write the code to use DataSet to
populate your ListView.
 
thanks,
but how?
can you give example how to i can bind dataset to listview?
how to i bind listview column to dataset column?

for example i add two columns to listview.. in design time..

how can i bind data?

y code:

Dim ws As New ws.azrael

Dim sqlDS As System.Data.DataSet

Dim drTeshis As SqlCeDataReader

sqlDS = ws.function

me.listview1.databind=Sqlds ????
 
You cannot bind listview to anything. You can fill it from the dataset by
walking DataSet.Tables(0).Rows collection
 
Back
Top