Your problem is the Npgsql.dll that is not being references. You only import the Namespace.
It's not best practice to hack SQL into a ASP.NET document... The solution would be adding the DLL to the web.config file:
...
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Npgsql, Version=2.0.11.93, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
...
But I recommend to create a class library project or at least a Web Application project using Visual Studio (Express version is FREE). Then right click on the directory named references and add the DLL there. Why? N-Tier (http://en.wikipedia.org/wiki/Multitier_architecture): better organization of code by it's intent. Easier to find errors and change/maintain code...