views:

48

answers:

1

is there some library for connecting to postgresql database and to have support for TransactionScope

I tried Npgsql but it doesn't yet support transactionscope

+1  A: 

You could try the library from Devart:

http://www.devart.com/dotconnect/postgresql/

Tobias Schittkowski
@Tobias Schittkowski tried it a bit, I managed to do an ExecuteQuery(), but ExecuteNonQuery() throws me errors, too bad they don't have simple examples just win forms stuff
Omu
@Omu Could you please specify what kind of error you have encountered?
Devart
@Devart it was something like: protected memory cannot be written/accessed. Btw could you include in your samples something simple, some console application with raw ado.net like: using(var conn = new PgConnection) using(var cmd = conn.CreateCommand()){ .... }
Omu
@Devart seems strange but today I don't get this error anymore, everything seems to work, except the speed of getting 100k rows is almost 2 times faster using npgsql
Omu
@Devart also I had to change the ExecuteScalar to return long instead of int (everybody's elses returns int)
Omu
Thank you for the comments. We will investigate the possibility to change the ExecuteScalar behaviour and the samples extension. As for the performance, could you please describe the test code? What protocol were you using? Have you set the UnpreparedExecute property?
Devart
The ExecuteScalar method returns the first column of the first row of the command result set. We do not perform any conversions, only take the type returned by the server. As for the samples, have you looked into the General samples? These samples contain the simplest use cases of the ADO.NET objects. Please describe what kind of additional samples is necessary in your opinion.
Devart