Questions tagged [dbproviderfactories]

53 questions
41
votes
8 answers

Add a DbProviderFactory without an App.Config

I am using DbProviderFactories in my data layer (based on Entity Framework) and am using SQLite for my database, but I don't have to have a App.Config to have the following code:
JasonRShaver
  • 4,344
  • 3
  • 32
  • 39
22
votes
5 answers

DbProviderFactory with Npgsql?

I have a project which I'm trying to port from SQL Server to PostgreSQL. I've got almost everything done I believe except for I can not get DbProviderFactory to work with Npgsql. Factory =…
Earlz
  • 62,085
  • 98
  • 303
  • 499
15
votes
1 answer

How can I use ADO.NET DbProviderFactory with MySQL?

How can I use ADO.NET DbProviderFactory with MySQL?
user366312
  • 16,949
  • 65
  • 235
  • 452
14
votes
4 answers

How to add custom DB provider to be accessible in Visual Studio?

I wanted to work with custom DB provider in Visual Studio. I need it to use Entity Framework. For example, I downloaded NpgSQL, registered them in GAC: gacutil -i c:\temp\npgsql.dll gacutil -i c:\temp\mono.security.dll and added to…
Anton
  • 9,682
  • 11
  • 38
  • 68
12
votes
4 answers

DbProviderFactories.GetFactoryClasses returns no results after installing .NET SQL Client in .NET Core 2.1

I'm porting a library over to .NET Core 2.1 now that it has support for DbProviderFactory. For the most part it has gone fine - it compiles, but when run I get an error: System.ArgumentException: 'The specified invariant name…
Allan Jardine
  • 5,303
  • 5
  • 30
  • 34
10
votes
4 answers

DbProviderFactories for .NET Error

I am having trouble getting the ODP.NEt library to work with the .NET DBProviderFactories. I am getting the following error with this code: _DBFactory = DbProviderFactories.GetFactory(providerName); An error occurred creating the configuration…
theringostarrs
  • 11,940
  • 14
  • 50
  • 63
8
votes
1 answer

Custom .NET Data Providers

Is is possible to use a custom .NET data provider without installing it in the GAC? Can I reference a custom DLL and register it inside my configuration file?
5
votes
1 answer

Choose the proper DbProviderFactory in .NET Core?

I have a .net core library that needs a DbProviderFactory passed into a service as a dependency. It should be SQL Server for the foreseeable future, so I thought I could do something like this: services.AddSingleton(di=>new…
Jeremy Holovacs
  • 22,480
  • 33
  • 117
  • 254
4
votes
1 answer

Getting exception using ProviderFactory to create a SQLite connection

I am trying to use the ProviderFactory.CreateConnection() to obtain a SQLite connection. I am getting a System.ArgumentException with the following message: "Keyword not supported: 'datetimeformat'." The connection string is: @"data…
Elan
  • 6,084
  • 12
  • 64
  • 84
4
votes
1 answer

Get Sqlite from DbProviderFactories.GetFactory()

I need to have DbProviderFactories.GetFactory() return the provider for Sqlite. However, I have Sqlite added to my project via NuGet and want to avoid having to put it in the GAC and update machine.config. One of the advantages of Sqlite is it is…
David Thielen
  • 28,723
  • 34
  • 119
  • 193
4
votes
1 answer

Why does my DbProviderFactory perform differently than SqlClientFactory?

I implemented a custom DbProviderFactory which returned the SqlX types except I added the following logic to CreateCommand public override DbCommand CreateCommand() { var cmd = new SqlCommand(); if (CommandCreated != null) …
Arrya Regan
  • 1,104
  • 8
  • 22
4
votes
1 answer

How to remove a provider from DbProviderFactories?

(Configuration: VS 2015 community, Windows 10 64bit, .Net 4.6.1) At one point I installed Npgsql Data Provider .Net Data Provider for PostgreSQL Npgsql Npgsql.NpgsqlFactory, Npgsql, Version=3.0.7.0, Culture=neutral,…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
4
votes
3 answers

Mocking DbProviderFactory

I am relatively new to unit testing, and completely new to mocking. I have a database class that wraps the DbProvider factory that I would like to create unit tests for without connecting to the database. How would I mock the DbProvider factory,…
Sean
  • 235
  • 4
  • 13
3
votes
1 answer

Code-First with SQL Server Express ; Operating System Error 2

I'm trying to generate a SQL Server Express embedded database (.mdf) with code-first Entity Framework. It used to work fine but now, I just get over and over the same error, and I cannot identify the issue. The problem occurs on the initialization,…
3
votes
1 answer

How do you unit test a DAL?

I have a Data Access Layer in my application which wraps an ADO.NET data provider. The DAL converts the data returned by the data provider into .NET objects. I've seen a lot of posts advising against unit testing the DAL, but it worries me that so…
sheikhjabootie
  • 7,308
  • 2
  • 35
  • 41
1
2 3 4