Bind GridView to Dataset
Hi,
I have a web service that publishes a typed dataset and a method that returns an instance of the typed dataset.
I have a webreference to this service in my asp.net project.
I have tried my version of the example on pge 1038 of ASP.net 2.0 but I just get whitespace not a grid.
I tried dragging an ObjectDatasource onto the form and binding that to the typed dataset but am having trouble getting that to work as well.
The dataset is being filled correctly as the Datatable has a finite record count which can be interrogated by the webpage.
My button code :
Service d = new Service();
this.GridView2.DataSource = d.GetMeters();//returns typed dataset
this.GridView1.DataBind();
It is a shame the book did not go into more detail in this area as it seems there are many ways of doing it wrong. I have tried quite a few of them :-)
Thanks
Bob
|