[Mono-list] Mono.Data.PostgreSqlClient can not be found in ASP.Net

amerigo5 amerigo5 amerigo5@hotmail.com
Mon, 26 May 2003 15:29:03 -0500


Hi,

I am testing to connect to PostgreSQL database in ASP.Net but I am getting 
the following error:

Error message: /tmp/tmp323549c1.cs(27,0) : error CS0246: The namespace 
`Mono.Data.PostgreSqlClient' can not be found (missing assembly reference?)
(0,0) : error failed: 1 error(s), 0 warnings

I am using the following code:

<%@ language="C#" %>
<%@ import namespace="System" %>
<%@ import namespace="System.Data" %>
<%@ import namespace="Mono.Data.PostgreSqlClient" %>
<html>
<script runat=server>
void Page_Load (object sender, EventArgs e)
{
if (!IsPostBack){
                string connectionString = 
"dbname=test1;user=testusername;password=testpassword;";
       IDbConnection dbcon;
       dbcon = new PgSqlConnection(connectionString);
       dbcon.Open();

       dbcon.Close();
       dbcon = null;
}
}
</script>
<head>
<title>PostgreSQL Test</title>
</head>
<body>
</body>
</html>

I know that the code inside the "Page_Load" function works in an ".exe" 
file. Do I have to do something when I connect to PostgreSQL using the 
"Mono.Data.PostgreSqlClient" assembly/namespace?

Thanks.

-G

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail