ASP. NET encountered a problem, "the object cannot be converted from dbnull to another type", record ~ The problem has been solved. Thank you ~

Source: Internet
Author: User

It's really strange that ASP. net in the project can query the processing cost function for a period of time. The local debugging is good, and there is no problem at all, but the transfer to the server has a problem ~ The problem is normal, but the problem is very strange. A text box that inputs the time, such as, can be entered, but the problem may occur when you input, or some time, it's really strange. Record it first, and then write the solution when the problem is found ~

As follows:

The query is as follows:

This is a local test, no problem:

This is a server test, and a problem occurs:

 

----------------------------------------------------------------------

Change Time:

There is no problem with the local server and the server:

 

I really don't know what the problem is. I have to debug it and find the reason ~

. Net versions are the same, all of which are 4.0 ~ That is, the local host is win7 + iis7, and the server is win2003 + IIS6

I don't know if it matchesRelated ~

 

The problem has been solved. It is the dirty data that has been input before the system is modified in the database, so there is a problem. Thank you ~ In the future, you will pay more attention to the database data when updating the system. I remember clearing the data may be a mistake, huh ~

The problem is that some data used to be null, but now the default value is 0, and then I convert the data to int, so there is a problem, low-level error, largeSorry ~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.