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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:57:45+00:00 2026-05-25T13:57:45+00:00

I’m loving MVC but unfortunately all the tutorials, demos and ALL resources use Entity

  • 0

I’m loving MVC but unfortunately all the tutorials, demos and ALL resources use Entity Framework to generate ViewData and most use LINQ to SQL instead of DataSets.
I’m reusing existing business logic and the client (who is a great coder in his own right) wants to keep using Datasets… so i cant move away from these.

I have one table that contains columns which are allowed to be NULL in the database. When i try to access these…even to check if it’s null i get an exception:

“The value for column ‘FNN_CARRIERS_DESC’ in table ‘FNN_CARRIERS_DESC’ is DBNull”

Now this is generated by the dataset.designer.vb file.

I know what you’re going to say. “FNN_BRAND IS Null!!!”
and that is true.
But…follow the stack trace and the line in my code that is generating this error is this:

 <%= Html.TextBox("FNN_CARRIERS_DESCTextBox", If(IsNothing(Model.FNN_CARRIERS_DESC), Model.FNN_CARRIERS_DESC, ""))%>

Guidance would be greatly appreciated! My inutition tells me this is not strictly an MVC problem but maybe something i don’t understand about datasets.

This is the code in the reference.vb file that throws the exception:

<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")>  _
    Public Property FNN_CARRIERS_DESC() As String
        Get
            Try 
                Return CType(Me(Me.tableVIT_FNN_CommsService.FNN_CARRIERS_DESCColumn),String)
            Catch e As Global.System.InvalidCastException
                Throw New Global.System.Data.StrongTypingException("The value for column 'FNN_CARRIERS_DESC' in table 'VIT_FNN_CommsService' is DBNul"& _ 
                        "l.", e)
            End Try
        End Get
        Set
            Me(Me.tableVIT_FNN_CommsService.FNN_CARRIERS_DESCColumn) = value
        End Set
    End Property

Things i’ve tried:

  • Commenting out the exception will make it return null which is what i want but the dataset will be rebuilt when the table changes or the stored procedure that generates the table result changes.
  • Changed the rules for the column on the datatable. actually yielded no result and will also be overridden on table regeneration.
  • IsNothing(column) or isDBnull(column) actually CAUSES the error because the column is being retrieved and casted.

I need to know the best way to solve this, hopefully keeping in with the MVC architecture.

Help me fellow nerds… you’re my only hope!

  • 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-25T13:57:46+00:00Added an answer on May 25, 2026 at 1:57 pm

    If anyone is interested i found a better solution… one that lets you keep using datasets without a layer in the middle.

    A column is nullable the dataset actually provides a method for you.

    Model.isFNN_CARRIERS_DESCNull()
    

    so one could check the nullability of this column…without causing a crash.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.