Asp.net bind datatable to gridview
<p>I know how to bind a simple datatable to a gridview, but this is a different scenario (I think). I am calling a class library dll which returns a class. I can say its kind of list.</p>

<p>I will call it like,</p>

<pre><code>Dim demo = New ABCDataTable()
demo = demo.GetTheDataTable(MyConnectionString)
GridView1.DataSource = demo
GridView1.DataBind()
</code></pre>

<p>Question: How do I bind this to gridview in a markup file? Which datasource control I have to use?</p>

<p>Update: </p>

<p>I used ObjectDataSource and assigned SelectMethod="GetTheDataTable" and used selectparameter to pass connection string. </p>

<p>I am assigning connection string in the code behind ObjectDataSource1.SelectParameters["connectionString"].DefaultValue = MyConnectionString;</p>

<p>but I am getting an error.</p>
