Re: Access postgresql data base from .net

From: Dann Corbit <DCorbit(at)connx(dot)com>
To: 'mike stanton' <mike(dot)stanton(at)autocastillo(dot)cl>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Access postgresql data base from .net
Date: 2010-11-05 23:11:11
Message-ID: 87F42982BF2B434F831FCEF4C45FC33E4207476A@EXCHANGE.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In theory, if you are already using a .NET data provider, then you simply change the data source. In practice, you might have to make a few small changes.

That is the entire beauty of using OLEDB, ODBC, .NET providers, etc. Since you are coding to an industry standard, every data access tool that conforms to the standard should work without modification.

Now, if you are sending a SQL string that says "SP_WHO" PostgreSQL is not going to give you a list of attached users because that command is Microsoft SQL*Server specific. But if you have a table with the identical data structure, then "SELECT ssn FROM employees WHERE bonus_conditions_met = 1" should work the same no matter what the data source is.

If you are using a database specific data interface (for instance, if you are connecting via DB-Library) then you will have to do some recoding, because DB-Library is specific to SQL*Server and Sybase.

If you have an ODBC connection to a database in your code, and all your calls are ODBC calls, and if the application is written properly, then changing the database should be as simple as setting up a new data source. Same for OLEDB. Same for JDBC. Same for .NET providers. This is the entire and fundamental reason for using these tools. Otherwise, we would all be using custom database API libraries instead.

From: mike stanton [mailto:mike(dot)stanton(at)autocastillo(dot)cl]
Sent: Friday, November 05, 2010 2:47 PM
To: Dann Corbit
Subject: Re: [GENERAL] Access postgresql data base from .net

Dann, perhaps the a better question would be.....if we use, for example, npgsql, we'd have to adapt code and use the tools own calls. And that means rewriting. Is this true?.

Cheers
Mike
----- Original Message -----
From: Dann Corbit<mailto:DCorbit(at)connx(dot)com>
To: 'mike stanton'<mailto:mike(dot)stanton(at)autocastillo(dot)cl> ; pgsql-general(at)postgresql(dot)org<mailto:pgsql-general(at)postgresql(dot)org>
Cc: mike stanton<mailto:mstanton(at)acsa(dot)cl>
Sent: Friday, November 05, 2010 5:12 PM
Subject: Re: [GENERAL] Access postgresql data base from .net

From: pgsql-general-owner(at)postgresql(dot)org<mailto:pgsql-general-owner(at)postgresql(dot)org> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of mike stanton
Sent: Friday, November 05, 2010 12:08 PM
To: pgsql-general(at)postgresql(dot)org<mailto:pgsql-general(at)postgresql(dot)org>
Cc: mike stanton
Subject: [GENERAL] Access postgresql data base from .net

Hello all; we´ve got a project where we have a system built originally for .net/sql-server. Now we want to change sql-server for a postgresql database. And preferably without using the ODBC driver which we have heard is prone to errors.
>>
What specific errors did you hear about?
I suggest testing the rumors. If there really is some problem, then submit a bug report.
Sometimes, people want you to use their tools, and so they will exaggerate the problem with competitive tools.
<<

Is there a producto which we can use which does not imply a major rewrite of all the SQL ?.
>>
Probably most interface tools will work if you are using ISO standard SQL. Any place where you are using SQL language extensions you will have to do some work.
You can find interfaces here:
http://pgfoundry.org/softwaremap/trove_list.php?form_cat=310

There are also a very large number of commercial interfaces for PostgreSQL available. You can find out about those here:
http://www.sqlsummit.com/DataAcce.htm
<<

Obviously we may have problemas with differences between Sql-server and Postgresql syntax, but we don´t want to de a rewrite.
>>
What specific problems are you having?
<<

Hope to hear soon, any help appreciated.

Mike Stanton W.
Santiago Chile

__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Figueiredo Jr. 2010-11-06 00:05:36 Re: Access postgresql data base from .net
Previous Message mike stanton 2010-11-05 21:40:40 Re: Access postgresql data base from .net