Обсуждение: How to improve PgSql Performance using npgsql
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.
2008/12/24 Venkat Rao Tammineni <vtammineni@roulacglobal.com>:
<snip/>
> try
> {
> pgSqlConnection.Open();
> }
> catch (Exception exp)
> {}
<snip/>
I don't think you've really given enough information for anyone to
answer your question but at the very least you shouldn't just ignore
your exceptions. Maybe something fails but you'll never know.