asp.net 2.0 and MySQL, PostgreSQL and Oracle 10g

SLWK

Guppy
How can I connect any of the following databases via asp.net 2.0?

1. MySQL
2. PostgreSQL
3. Oracle 10g
 
OLE and ODBC are now available on both MySQL and Oracle, and ODBC for postgres(the ole driver is beta, and I won't be running that)
 
I'm having problems with postgresql and oracle. Mysql works now.

The connection string I'm using for postgresql is

Driver={PostgreSQL};Server=;Database=;
User=;Password=;

which is similar to the mysql one except for the driver string.

Running "Select version()" produces

"The driver doesn't support the version of ODBC behaviour that the application requested (see SQLSetEnvAttr)."

Any ideas on this one?

For oracle, using OLEDB and MSADORA

Provider=MSADORA;Data Source=;User ID=;Password=;

I get "The 'MSADORA' provider is not registered on the local machine."

Using OLEDB and ORAOLEDB

Provider=ORAOLEDB;Data Source=;User ID=;Password=;

I get "The 'ORAOLEDB' provider is not registered on the local machine."

And I get similar messages for OraOLEDB.Oracle and OraOLEDB.Oracle.1
 
I tried ODBC for Oracle and it doesn't work either.

The query I'm trying is

"select * from v$Version"

which is supposed to just return the version number -- akin to "select version()" for mysql.

Any chance of getting OracleClient, given that it is the data provider/driver that Oracle recommends for 10g. I read somewhere that because 10g is so new, that some of the older drivers don't work properly and that it is best to use the latest driver from oracle.

Also, any ideas on the PostgreSQL problem? I don't know much about PostgreSQL.
 
I had an error during the oracle install, but some DLL's were copied, I guess it did not work.

Postgress ODBC went well, checking to see why it is not working now.
 
I just tried postgresql with a dsn and it works. So that one is now ok. The first attempt was with a dsnless connection.
 
I don't know but I reinstalled the Postgres, I would try it dnsless again if you can :)
 
Ok I spotted something

The first try was

Driver={PostgreSQL};Server=;Database=;
User=;Password=;

which is similar to the syntax I used for MySQL.

I just noticed that Hsphere's dsn builder uses UID and PWD instead of User and Password

So a dsnless connection string for postgresql should actually be

Driver={PostgreSQL};Server=;Database=;Uid=;Pwd=;

So postgresql is now ok. Both dsn and dsnless connections are ok.
 
i am still getting error during the installer, I will be speaking with Tanmaya this evening to get it resolved, as he is more experienced with Oracle(I have no experience, and am not sure how to resolve this error, and for once google was not helpful)
 
I think Microsoft's data provider for oracle, OracleClient, is built into the .net framework. No further installations are needed. In this case, it should simply be a matter of permitting OracleClient -- ie, adding OraclePermission to the trust file.

http://msdn.microsoft.com/library/d...us/cpref/html/frlrfsystemdataoracleclient.asp

Alternatively, oracle has a data provider for .net

http://www.oracle.com/technology/tech/windows/odpnet/faq.html

If possible, it would be better to use Microsoft's provider because Microsoft's provider is a part of the .net framework and there are no potential complications in regard to licensing issues. Also using Oracle's provider would require users to customise their code and be depended on files from oracle.

The other thing I should say is that I read somewhere that Microsoft .net's Odbc and OleDb might have problems with 10g. Microsoft recommends OracleClient for connecting to 10g.
 
Interesting find, all that time I was trying to get oracles .net and ODBC drivers working, and they kept giving errors.
 
So what is the solution? This issue has been going on for over a week. I am behind schedule. Can you just permit OracleClient?
 
I enabled "OraclePermission", but I think the problem was in the security descriptor where I think I have made the proper change now.
 
Still the same. Maybe a reboot or something is needed?

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Data.OracleClient.OraclePermission, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
 
Back
Top