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

  • Home
  • SEARCH
  • 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 3302676
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:52:36+00:00 2026-05-17T20:52:36+00:00

I have a method that takes an System.Action, this is what I’m trying to

  • 0

I have a method that takes an System.Action, this is what I’m trying to feed it:

Function() Me._existingImports = Me.GetImportedAds()

The thing is that it complains about the = sign since it thinks I’m trying to do a comparison, which I’m not. I want to assign the Me._existingImports the value of Me.GetImportedAds(), but VB.NET complains about DataTable not having a = operator.

How can I force it to use the assignment operator instead of the equality operator?

In C# this works perfectly fine:

() => this.existingImports = this.GetImportedAds()

For now the solution will be to use a standalone method, but that’s way more code than needed.

  • 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-05-17T20:52:37+00:00Added an answer on May 17, 2026 at 8:52 pm

    When using Function(), you really define an anonymous function which means you map values to values.

    Therefore Function() strictly needs an expression (like x or 42 …) as the body, which an assignment is not! (Assignments don’t evaluate to values like in C-style languages in VB)

    Thus what you need is not a Function() but a Sub(), which contains statements (actions) rather than values.

    Sub() Me._existingImports = Me.GetImportedAds()
    

    C# doesn’t distinguish here, the (much nicer) ... => ... syntax covers it all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that takes a mac address from a string and converts
Lets assume i have a function that takes 32bit integer in, and returns random
Didn't know how else to put this. Say I have a JavaScript method that
I would like to make a method that takes in a block, saves it
I have the following method for running shell commands in my java applications and
In my vb program, I have two forms that work together to allow you
I'm pretty much new at WCF and have a performance question. I have the
I have seen there are many JSON parsers in Java. Some target speed, some
I have a table with observations (x, y) and need to estimate the mean
I am working on a fairly large MVC 3 application, and I'm running into

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.