Master/Detail filtering with a dropdownlist ASP.NET C#
<p>I have a gridview with selected value bound to a dropdownlist control. I was following <a href="http://www.asp.net/data-access/tutorials/master-detail-filtering-with-a-dropdownlist-vb" rel="nofollow">this</a> so far I could manage to show some data if a user select a value from the dropdownlist but what I want is to show all records in '-- Choose a category --'</p>

<p>Here's the GetUser Method but what I want is C# version of it.</p>

<pre><code>Public Function GetProductsByCategoryID(categoryID As Integer) _ As Northwind.ProductsDataTable 
  If categoryID &lt; 0 Then 
    Return GetProducts() 
  Else 
    Return Adapter.GetProductsByCategoryID(categoryID) 
  End If 
End Function
</code></pre>
