Grid View ASP Net connecting to a web service
Posted on 2006-05-29
I am binding a grid view to a web service. The data displays fine, however, I am trying to pull out a column value when the user clicks on the select button within the grid. I am using the following code:
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
I recieve a nullreferenceexception error, it as if the grid has not been populated. IF I connect straight to a SQL server it works fine, so it must be something to do with the way I am connecting to the web service:
Me.GridView1.DataSource = ConsumeWebService.SearchForEstablishment(Username, Password, Session("SearchEstablishmentName").ToString, "", "", "", "", "", "", "", "", EdacID)
Me.GridView1.EnableViewState = True
Is there a property on something I need to set on the grid view?