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 326231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:17:24+00:00 2026-05-12T09:17:24+00:00

In VB.NET, why can’t I see a member of a structure when I make

  • 0

In VB.NET, why can’t I see a member of a structure when I make it a nullable type?

Example:

Public Structure myNullable  
    Dim myNullVar As Integer  
End Structure

Sub Main()  
    Dim myInstance As myNullable 'This works.  
    Dim myNullableInstance? As myNullable 'This works.   
    myInstance.myNullVar = 1  'This works.     
    myNullableInstance.myNullVar = 1   'This doesn't work.  
End Sub
  • 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-12T09:17:25+00:00Added an answer on May 12, 2026 at 9:17 am

    As others have said, you need to use the Value property to fetch the value. However, System.Nullable<T> is immutable – the Value property is read-only. It will be returning a copy of the value, so even if you could change the field, it wouldn’t do what you want.

    This is actually a good thing – value types should be immutable. Mutable structs are horrible – if the fact that Nullable<T> makes it hard to use your type pushes you down the immutability route, that’s great.

    Make your field read-only, and add a constructor to let you pass in the value. Then instead of trying to modify the nullable value, assign an entirely new value to the variable.

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

Sidebar

Related Questions

When we define a property like public string Name {get; set;} dot net can
ASP.NET MVC can generate HTML elements using HTML Helpers, for example @Html.ActionLink() , @Html.BeginForm()
I know ASP.NET can be configured to handle any file type in any way,
Does anyone have a working example where protobuf-net can be used as a drop-in
I have this exact issue ASP.net can’t update page from event handler and it's
Is there any limit that application state in asp.net can store ?? Am trying
.NET: How can I copy the files using Windows Copy Files dialog. I need
Can .NET (managed code) read and write to CouchDB? I would like to build
by using directshow.net i can able to record the video and with recording i
In TestDriven.Net I can set the following from the TestDriven.Net Options Pane Run tests

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.