• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1967
  • Last Modified:

Value cannot be null. Parameter name: path2

I get this error when trying to open aspx page. everything works fine on the development workstation (sql server and iis are on the same machine). when i moved this code to production (i changed web.config to point to correct sql server) and ran it, i get this exception.

1 Solution
Most likely the development database and the production database have different schema.

In particular, the database field associated with Path2 probably has an additional constraint on it specifying that it may not be Null.

You can fix it by:
(1) removing the constraint on the production server if and only if that is appropriate (There's some reason that constraint is there.)
... or ...
(2) changing the code, such that it doesn't ever attempt to store a Null.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now