Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

How to improve PgSql Performance using npgsql


  • From: "Venkat Rao Tammineni" <vtammineni(at)roulacglobal(dot)com>
  • To: <pgsql-sql(at)postgresql(dot)org>
  • Subject: How to improve PgSql Performance using npgsql
  • Date: Thu, 25 Dec 2008 12:09:35 +0530
  • Message-id: <001c01c9665b$8f007a00$ad016e00$@com> <text/plain>

Dear All,

 

  I am using   npgsql.dll to connect  postgresql database. Everything is
working fine.but sometimes database is getting slow and even sometimes I am
not getting data .I have written one function which access the data .

 

Below is my code ..

 

 public  NpgsqlConnection PgSqlDataConnection()

        {

            if (pgSqlConnection != null)

            {

                if (pgSqlConnection.State == ConnectionState.Open)

                {

                    pgSqlConnection.Close();

                    //pgSqlConnection.Dispose();

                }

            }

            pgConnectionString =
ConfigurationSettings.AppSettings["ConnectionString"].ToString();

            pgSqlConnection = new NpgsqlConnection(pgConnectionString);

            try

            {

                pgSqlConnection.Open();

            }

            catch (Exception exp)

            {}

            return pgSqlConnection;

       }

       

Please let me where I am doing wrong.

 

I am waiting for your great response.

 

Advanced thanks.

 

Reagrds,

Venkat. 



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group