Re: Connection String in ASP.NET application - Mailing list pgsql-novice

From wireless200@yahoo.com (wireless)
Subject Re: Connection String in ASP.NET application
Date
Msg-id 90446ee7.0309170507.47646af8@posting.google.com
Whole thread Raw
In response to Connection String in ASP.NET application  ("Roslyn Teo" <roslyn@crimsonworks.com.sg>)
List pgsql-novice
roslyn@crimsonworks.com.sg ("Roslyn Teo") wrote in message news:<002901c37b7a$e100abd0$5201a8c0@rospc>...

> Can anyone kindly enlighten me on how to write a connection string from
> an ASP.NET application to PostgreSQL db without the use of Npgsql or
> other data providers?

You can use odbc but I use npgsql:

using Npgsql;

String connstring = "Server=xx.xx.xx.xx;Port=5432;User
id=user;Password=password;Database=dbname";

NpgsqlConnection conn = new NpgsqlConnection(connstring);

conn.Open();

DataSet ds = new DataSet();
da.Fill(ds,"mydataset");
conn.Close();

You can do all the .net stuff with npgsql.  They've done a good job
with it.

Just download the npgsql.dll and add it to your web bin directory and
add a reference in your project.

If you want to use odbc just do some searches on google.  There a few
how to articles but it's more complicated than npgsql.

-David

pgsql-novice by date:

Previous
From: Harry Broomhall
Date:
Subject: Schemas, and visibility of tables in MS-Query.
Next
From: "Smitha V. Babu"
Date:
Subject: tutorial for win32 programming