title: Correct Linq conversion from C# to Vb.net
body: <p>I am looking for an accurate conversion of this C# Linq code to VB.net. I have tried a number of tools to convert the C# to VB, but none of the VB converted statements return the correct results.</p>
  
  <p>C#</p>
  
  <pre><code> var rows = GridView1.Rows.Cast&lt;GridViewRow&gt;().Where(a =&gt; a != row).ToList(); 
  </code></pre>
  
  <p>VB.net</p>
  
  <pre><code> Dim rows = GridView1.Rows.Cast(Of GridViewRow)().Where(Function(a) a IsNot row).ToList()
  </code></pre>
  
  <p>The process is suppose to select the rows of a Gridview, excluding the row selected by a click.
  All rows are return, no row is excluded...</p>
  
  <p>C#</p>
  
  <pre><code>Button btnUp = (Button)sender;
  GridViewRow row = (GridViewRow)btnUp.NamingContainer;
   // Get all items except the one selected
  var rows = GridView1.Rows.Cast&lt;GridViewRow&gt;().Where(a =&gt; a != row).ToList();
  </code></pre>
  
  <p>VB.net</p>
  
  <pre><code>Dim btnUp As Button = DirectCast(sender, Button)
  Dim row As GridViewRow = DirectCast(btnUp.NamingContainer, GridViewRow)
  ' Get all items except the one selected
  Dim rows = GridView1.Rows.Cast(Of GridViewRow)().Where(Function(a) a IsNot row).ToList()
  </code></pre>
  
  <p>Thanks for any and all help.</p>