I'm creating an ASP MVC 3 website. I have a Postgresql database - I'm using Entity Framework 6 - I have referenced Npgsql and Npgsql.EntityFramework and installed dotConnect for PostgreSQL. The connection with the Postgresql database works fine - when I want to add a database connection I have PostgreSQL server in the data source list:
But when I want to add an ADO.NET Entity Data Model to the project there isn't PostgreSQL server in the data source list :
Related
I am stuck in the middle of a project. I am having an issue with adding the data source in "Entity Data Model Wizard"
Navigation Path:::::
Solution Explorer : Models(Folder): Add : New Item : ADO.NET Entity Data Model : EF Designer From Database : New Connection
Now here in "New Connection" I want to connect my postgresql database using Postgresql Datasource but I have only SQL Server datasource option there, Anybody know how to deal with this ERROR..??
Note: I have added Npgsql, entityframework5.Npgsql through NuGet.
I have an application which can connect to OLE DB data sources, however, my proprietary database has only ADO.NET provider.
Is there any ADO.NET to OLE DB bridge which could helps me to connect to ADO.NET data source?
EDIT:
I do not have control on application. It is some kind of reporting service. Here is how I expect to connect:
App <-> OLE DB Provider <-> (bridge?) <-> ADO.NET Data Source
Everything is running on Windows machine
You didn't mention the platform so I am going to assume things and point you to some direction.
For the .NET Framework Data Provider for OLE DB, the connection string
format is identical to the connection string format used in ADO
For more details you can refer to this page to get started:
Connecting to an OLE DB Data Source Using ADO.NET
And also it wouldn't hurt to have a look at this title Connecting to an OLE DB Data Source
in the following MSDN article (.NET 4.5)
Establishing the Connection
Update
On the other hand to access a ADO.NET data source using an OLE DB you can follow this example.
However if you mean by the word "bridge" to have something like
using (SqlConnection connection = new SqlConnection(oleConnectionString))
where, oleConnectionString is an originally an OLE connection string which is converted to act as an SQL connection string?! I am not sure if that's possible.
ADO.NET Sample
I have the following code to generate the schema for a database in Nhibernate
new SchemaExport(configuration).Execute(true, true, false);
but when run against a PostgreSQL database, I end up getting the following error
[NpgsqlException (0x80004005): FATAL: 3D000: database "dbname" does not exist]
If I however create the database manually, the schema is exported without errors. An so the question: Why is Nhibernate SchemaExport unable to create a PostgreSQL database and yet this works against other databases like SQLite, MsSqlCe and MsSql Server.
I have searched for online literature but have been unable to locate any highlighting on this issue.
I am using Nhibernate 3.3.1 with PostgreSQL 9.2.
You must create the database before you can create the tables and other objects within the database.
Do this with a CREATE DATABASE statement on a PostgreSQL connection - either in your app, or via psql or PgAdmin-III.
PostgreSQL doesn't support creating databases on demand / first access. Perhaps that's what your tool is expecting?
If you think the DB does exist and you can see it in other tools, maybe you're not connecting to the same database server? Check the server address and port.
I'm using Laravel 3 and MongoHQ database.
In some tutorials (example: http://codehappy.daylerees.com/authentication) I need to create Schemas and Migrations, but how to do this with NoSQL database? Or should I keep this step?
Laravel (Version 4&3) uses the Eloquent ORM for database work. (including Migrations and Schemas)
Currently Eloquent only supports four database systems: MySQL, Postgres, SQLite, and SQL Server.
With MongoHQ you can not create Migrations or Schemas.
Source: https://laravel.com/docs/database
What is the difference between adodb and oledb?
What is the relation between these two?
Where does ado.net stands in context of adodb and oledb?
Adodb (ActiveX Data Objects DB) is an API layer over OLE DB. It works well with MS-based databases such as Sql Server, providing a consistent API and optimizations. That being said you can use ADODB to connect with non-MS data sources as well but that would mean that you will require an OLEDB/ODBC Provider for the data source.
In simpler terms, to connect to any data source you need a driver. Here are a couple of common scenarios to think of:
ADODB for Data Source that has ODBC Driver Only - ADODB uses OLEDB Provider for ODBC which loads ODBC Driver which then connects to Data Source.
ADODB for Data Source with OLEDB Driver (like SQL Server) - ADODB uses OLEDB Provider for SQL Server to talk directly with DB.
Oledb (Object Linking and Embedding DB) is a standard format supported by a large number of dbs, so you can connect to oracle, db2 etc. using Oledb. You can also use OLEDB directly to connect to Sql Server but the API is messier as compared to a adodb connection which is optimized to work with Sql Server and MS Access.
ADO.Net is a .Net based db connection "architecture". In ADO.Net there's a library for Oledb - System.Data.OledbClient. Adodb has been replaced/upgraded and ADO.Net now uses the System.Data.SqlClient library for MS-based databases/data providers.
ADO is a COM-based library for accessing databases.
OleDB and ODBC are standards for communicating with databases.
ADO uses the OleDB to talk to any database that exposes an OleDB driver.
There is also an OleDB driver that can wrap any ODBC driver. Thus ADO can also talk to any database that exposes an ODBC driver.
ADO.NET (a.k.a. System.Data) is a .NET based library for accessing databases.
ADO.NET has built-in support for SQL Server, OleDB, and ODBC
Third parties can expose their database to ADO.NET by building a ADO.NET compatible library
Third parties can also expose their database to ADO.NET by offering an OleDB or ODBC driver