How do you get RowCount of GridViews ObjectDataSource
<p>I need to get the ObjectDataSource RowCount i've tried this</p>

<pre><code>System.Data.DataTable dt = (System.Data.DataTable)gview.DataSource
dt.Rows.Count
</code></pre>

<p>But i get object not set to an instance of an object</p>
