Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8965349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:47:05+00:00 2026-06-15T16:47:05+00:00

I am looking for an accurate conversion of this C# Linq code to VB.net.

  • 0

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.

C#

 var rows = GridView1.Rows.Cast<GridViewRow>().Where(a => a != row).ToList(); 

VB.net

 Dim rows = GridView1.Rows.Cast(Of GridViewRow)().Where(Function(a) a IsNot row).ToList()

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…

C#

Button btnUp = (Button)sender;
GridViewRow row = (GridViewRow)btnUp.NamingContainer;
 // Get all items except the one selected
var rows = GridView1.Rows.Cast<GridViewRow>().Where(a => a != row).ToList();

VB.net

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()

Thanks for any and all help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:47:06+00:00Added an answer on June 15, 2026 at 4:47 pm

    Try this:

    Dim btnUp As Button = DirectCast(sender, Button)
    Dim row As GridViewRow = DirectCast(btnUp.NamingContainer, GridViewRow)
    Dim rows = GridView1.Rows.Cast(Of GridViewRow)().Where(Function(a) a <> row).ToList()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking to do a bit of refactoring... Using NHibernate I have this query currently
Looking for best advice on how to do this: I have an insert like
Looking at some of the code System.Linq I've come across some examples of Buffer<TSource>
I'm looking at this code, I can see that is says actions: show and
Looking at some assembly code for x86_64 on my Mac, I see the following
Looking at the Ehcahce implementation of net.sf.cache.JS107, I am trying to achieve the following
Looking for a simple bit of JS to count the number of items in
We're looking to develop a mobile website. On this mobile website, we'd like to
I was looking at the Golden Ratio formula for finding the nth Fibonacci number,
Has anyone written, or know of a library, that generates fairly accurate looking Western

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.