title: Dynamically populate ASP.NET Gridview from jQuery AJAX call
body: <p>Error:</p>
  
  <pre><code>cannot refer to an instance member of a class within a shared method
  </code></pre>
  
  <p>I'm working on a web application that pulls data from a MSSQL server on the backened. Calling my web method from ajax isn't the issue, it's displaying the data once it has been received.</p>
  
  <p>I have the following gridview on my report page:</p>
  
  <pre><code>&lt;asp:GridView ID="gridReport" runat="server"&gt;&lt;/asp:GridView&gt;
  </code></pre>
  
  <p>The web method that is pulling the data from the DB is called DBManager.asmx, it is declared as follows (this is called via ajax each time a drop-down is changed):</p>
  
  <pre><code>&lt;WebMethod()&gt; _
  Public Function GetSpecificReport(ByVal strFilter As String) As String()
  </code></pre>
  
  <p>(it is NOT the code-behind file for the report page) The data being returned from the DB is currently in a DataSet (variable name: ds).</p>
  
  <p>Is there any way to assign the <code>DataSource</code> for that GridView to the DataSet pulled from the .asmx file, or a nice workaround that I could try? I've tried creating shared methods in the code-behind report page with no luck, as well as putting the GetSpecificReport method inside the code-behind. </p>
  
  <p>Thanks for the help, let me know if I should give more info or post more code.</p>