If you're running (e.g. debugging) your project within Visual Web Developer / Visual Studio / etc, it's likely running using the embedded web server. The embedded web server puts itself in a "sandbox" so it won't inherit any of the attributes set in the toplevel application / web site.
Where do you configure the data source name for your SQL connection? In the top level web site? In a parent application?
Does it work if you change the project properties to target local IIS instead of running on the embedded web server?
If so, you'll just have to move the connection string to the local web.config file, so that your new application can find it.