What is the difference between driver and provider in database? Is there are any explanation will be grateful.
sample : ADO.NET driver for MySQL vs providerName="System.Data.EntityClient"
From the MSDN Forum:
Driver is a program installed on a workstation or a server; it allows programs to interact with a Database Management System (DBMS). Such as, JDBC driver provides database connectivity through the standard JDBC application program interface (APIs) available in J2EE.
A data provider is a set of libraries that is used to communicate with data source. Such as, SQL data provider for SQL, Oracle data provider for Oracle, OLE DB data provider for access, excel and MySQL. It serves as a bridge between an application and a data source and is used to retrieve data from a data source and to reconcile changes to that data back to the data source.
Source: MSDN-Forum
Provider is a connectivity with particular database like Sql Server, Oracle, but we import namespaces like using system.data.msdaora, using system.data.sqlclient.
After write connection class it takes string connection string takes 4 statements uid, pwd, database, server.
After open connection by using cn.Open method.
After executing statements.
After connection close.
Related
Again I am facing a problem retrieving data from a database system - this time I'm trying to connect to Postgresql.
I installed a postgresql Server locally and created a sample database. I can connect to the server and query data via the postgres command window - so far so good.
Furthermore - after unsuccessfully trying to get a working free OleDB provider - I installed the ODBC Drivers for Unicode in 32 bit and 64 bit version. Using the ODBC Datasource managers (64 and 32 bit) I can create ODBC Sources - connection succeeds.
Now what does NOT work: according to connectionstring.com, it should be possible to connect to the server with a regular connectionstring, providing servername, UID, PWD and so on. Trying to connect to the Server via Connectionstring, I receive the message Data source name not found and no default driver specified. If I define the connectionstring with the ODBC Data Source, everything works fine.
As far as I understood, this should be possible WITHOUT the need to define a ODBC Datasource for each and every database. Since the application will dynamically connect to something like 20-50 Databases, it would be great, if I could stick to the dynamic connection strings instead of the datasources.
Additional: I managed to get the connection working with npgsql, but nevertheless it would be great to use OleDB (which I gave hope up to get it running...) or ODBC with the Connectionstrings without additional manual effort for each DB.
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
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.
How can i export from MySQL to MS ACCESS 2007 in c#? Any tutorials?
Regards,
Alexandru Badescu
You can use NHibernate with 2 session factories, load entities from MySQL and persist them to MS Access.
This would help if you will change databases in the future.
Also respects referential integrity
In Access, go to File => get external data, Import, then choose ODBC as your source. You have to have the MySQL ODBC drivers installed first, and in the process you may have to set up a DSN. Once you've connected, you'll see a list of tables and then you can import them. Whether or not this will get the data types correct is an open question.
If this is something you need to do often, then you should set up an empty shell Access database and then import the data with INSERT queries that specify the ODBC connect string to the MySQL database in the FROM clause.
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.