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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:08:13+00:00 2026-05-11T04:08:13+00:00

I need some expect advice on how to handle the following:- I have a

  • 0

I need some expect advice on how to handle the following:- I have a data field misc_text_2 that is of type varchar(25) and allows NULL. Now if I use the following syntax

<asp:Label ID='lblPrinter' runat='server'  Text='<%# iif(eval('misc_text_2') is dbnull.value, '', iif(eval('misc_text_2') like 'NA', 'None', iif(eval('misc_text_2') like 'KP1', 'Kitchen Printer 1', iif(eval('misc_text_2') like 'KP2', 'Kitchen Printer 2', iif(eval('misc_text_2') like 'KP3', 'Kitchen Printer 3', iif(eval('misc_text_2') like 'BP1', 'Bar Printer 1', iif(eval('misc_text_2') like 'BP2', 'Bar Printer 2', iif(eval('misc_text_2') like 'BP3', 'Bar Printer 3', Eval('misc_text_2')))))))))%>'></asp:Label> 

I keep on getting an error Exception Details: System.InvalidCastException: Conversion from type ‘DBNull’ to type ‘String’ is not valid.

I know I’m missing something, but what…

Thanks in advance

  • 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. 2026-05-11T04:08:13+00:00Added an answer on May 11, 2026 at 4:08 am

    You could in your sql query use isNull(misc_text_2, ”) to return en empty string instead of DBNull.

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

Sidebar

Related Questions

I have to implement an application for my university and I need some advice
I am dealing with an issue and need some expert advice on to achieve
Need some regular expressions help. So far I have my code working to allow
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need some quick advice I am trying to access a object array but I
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
I have the following situation and I'm expecting some expert advise from SO folks.
I have an existing Java client that I need to build a web service
I am implementing an automatic update feature and need some advice on how to

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.