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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:36:36+00:00 2026-05-13T23:36:36+00:00

Why does the following query raise the error below for a row with a

  • 0

Why does the following query raise the error below for a row with a NULL value for barrel when I explicitly filter out those rows in the Where clause?

Dim query = From row As dbDataSet.conformalRow In dbDataSet.Tables("conformal") _
            Where Not IsDBNull(row.Cal) AndAlso tiCal_drop.Text = row.Cal _
            AndAlso Not IsDBNull(row.Tran) AndAlso tiTrans_drop.Text = row.Tran _
            AndAlso Not IsDBNull(row.barrel) _
            Select row.barrel
If query.Count() > 0 Then tiBarrel_txt.Text = query(0)

Run-time exception thrown : System.Data.StrongTypingException - The value for column 'barrel' in table 'conformal' is DBNull.

How should my query / condition be rewritten to work as I intended?

  • 1 1 Answer
  • 1 View
  • 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-13T23:36:36+00:00Added an answer on May 13, 2026 at 11:36 pm

    By default, in strongly typed datasets, properties throw that exception if the field is null. You need to use the generated Is[Field]Null method :

    Dim query = From row As dbDataSet.conformalRow In dbDataSet.Tables("conformal") _
                Where Not row.IsCalNull() AndAlso tiCal_drop.Text = row.Cal _
                AndAlso Not row.IsTranNull() AndAlso tiTrans_drop.Text = row.Tran _
                AndAlso Not row.IsbarrelNull() _
                Select row.barrel
    If query.Count() > 0 Then tiBarrel_txt.Text = query(0)
    

    Or the DataRow.IsNull method :

    Dim query = From row As dbDataSet.conformalRow In dbDataSet.Tables("conformal") _
                Where Not row.IsNull("Cal") AndAlso tiCal_drop.Text = row.Cal _
                AndAlso Not row.IsNull("Tran") AndAlso tiTrans_drop.Text = row.Tran _
                AndAlso Not row.IsNull("barrel") _
                Select row.barrel
    If query.Count() > 0 Then tiBarrel_txt.Text = query(0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following query does not work, and produces an error: A transport-level error has
The following query does not work and it keeps giving a weird error: keys
Does anyone know why the following query fails in Derby? delete from MyTable where
I am wondering why the following regex does not match. string query = \1
Can anyone explain what the following PHP Code does function query($query_string) { if ($query_string
Why does following code snippet doesn't work? It doesn't gives any error, but also
Does following update query always leave table data unchanged? update mytable set column1 =
Why does the following query work, when there is no column named Agentid in
The following query does not update the datetime field: update table SET EndDate =
I have an Incident table with one row that has the value 'out of

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.