Is Nhibernate using ADO.NET for connecting to database? - c#

What is the data provider for nhibernate? Is it ADO.NET?

Yes it uses ADO.NET internally.

Take a look at http://community.jboss.org/wiki/DatabasesSupportedByNHibernate.
It shows what tools/drivers are used to connect to different databases. for example:
Oracle 9i and 10g are supported, both using Microsoft driver (System.Data.OracleClient) and using Oracle driver (Oracle.Data.OracleClient).
Or:
To work with Firebird, install the latest Firebird .NET Data Provider.
I'm not sure whether it uses ADO.Net for SQL Server connections under the hood, But it seems that it doesn't use ADO.Net for other database systems.

Related

Creating classes in C# from Informix tables

I know that there is POCO Generator but that's for SQL Server and I need it for an Informix database.
Can you point me to any alternative?
BTW I am using an Informix data server driver in C# to connect to an Informix server.
You could use LINQ to DB, which support couples of databases such as Informix:
Supported databases:
DB2 (LUW, z/OS)
Firebird
Informix
Microsoft Access
Microsoft Sql Azure
Microsoft Sql Server
Microsoft SqlCe
MySql
Oracle
PostgreSQL
SQLite
SAP HANA
Sybase ASE
I hope to be helpful for you:)

Entity Framework with Oracle AND SQL (switch automatically)

I maintain an asp.net MVC application which uses Entity Framework (database first) and connects to an oracle database.
My question:
How can I switch between oracle and SQL server using entity framework?
The meaning has the ability to get data from both oracle and SQL server. Also, the switch from oracle to SQL server (if it is possible) should be automated.
After a search, I found that I can switch between oracle and SQL server in the same app by:
Creating repositories for 2 models
Using mapping with 2 .edmx files. In this way, one of them will generate the code of model and entity classes and the other is used as a source of XML resources.
Also, I found other useful info but they are all very general.
How do I convert oracle edmx to the sql_server equivalent?
During my search, I migrated my oracle database using Microsoft's SSMA to an SQL server database so now I have the same database in oracle and also in SQL SERVER.
Does someone knows the steps to get me a bit closer to solution?

ORACLE Data Provider Not showing up as an Option

I am trying to use ADO.NET Entity DATA model (edmx) to connect to Oracle, i have installed the Oracle data provider from Oracle.
But i do not see the data provider as an option when i try to add a new connection for the ADO entity data model.
However I can see the Oracle data provider when i am trying to connect to the DB using from the sever explorer in VS 2010.
Any ideas ?
i had to install this beta version to get it to work. http://www.oracle.com/technetwork/topics/dotnet/downloads/oracleefbeta-302521.html

How to choose an Oracle provider for .Net application?

I am trying to figure out what is the best way to connect an (existing) ASP.Net application to an Oracle database to read its dictionary information.
There are simply too many possibilities:
MS Data Provider for Oracle (requires 8.1.7, namespace System.Data.OracleClient)
Oracle Data Provider for .NET (requires 9.2, namespace Oracle.DataAccess)
Oracle Provider for OLE DB
MSDASQL and ODBC
As my current app uses MSSQL server, further options would be:
Linked Server, access via server..user.object
Linked Server via OPENROWSET
There are a couple of questions on similar topics on SO, but only some have accepted answers.
What's your experience with each of the drivers? What are their pros and cons?
Of course Oracle is recommending ODP.Net. Is the requirement of version 9.2 (or higher) a problem today?
I too recommend ODP.NET. Choose the latest provider (http://www.oracle.com/technology/tech/windows/odpnet/index.html). It can connect with an Oracle 9.2 database or a newer release of the database.
The MS Data Provider for Oracle is very limited. You can't work with arrays for example and user defined types. And why would Microsoft provide good support for connecting to Oracle?
You can also check out the provider of devart: http://www.devart.com/dotconnect/oracle/ . It supports the entity framework.
Dump OLE DB and ODBC options, if you have direct data access provider there is no need in using OLE DB or ODBC.
I recommend Oracle Data Provider for .NET.
Microsoft just announced it is deprecating System.Data.OracleClient.
I think that leaves you with a few choices (at least):
ODP.NET (free, from Oracle)
DevArt
DataDirect
DevArt also has a LINQ to Oracle implementation which could be interesting to you.

Connectiong from C# to MySQL without any third party components?

I was always connecting to SQL which was simple, but now I would need to connect to a MySQL server. I thought System.data.odbc connection will work, but it doesnt connect. I do not udnerstand whather I really need to download and install any third party stuff like Connector or even MyODBC, I thought ODBC in .NET is enough. Could you please advice?
So far I am using:
string ConString = #"driver={MySQL ODBC 3.51 Driver};server=localhost;database=db;uid=band;pwd=letmein;";
dbconn.ConnectionString = ConString;
dbcon.Open();
Thank you in advance.
There are various possibilities to connect to a MySQL database. A list of them (and the necessary connection strings) can be found on this excellent site: http://www.connectionstrings.com/mysql
Edit: Since you're trying to avoid third-party connectors (even though I recommend them, because they were written specifically for the target db), you should look out for ".NET Framework Data Provider for OLE DB" or ".NET Framework Data Provider for ODBC" in the list
You need either a odbc driver for MySQL or a .Net Framework Class to use (ie MySql.Data.MySqlClient.MySqlConnection)
.Net and Windows doesn't include native support for MySQL

Categories