All Questions
Tagged with connection-string entity-framework
488
questions
395
votes
10
answers
423k
views
Entity Framework Timeouts
I am getting timeouts using the Entity Framework (EF) when using a function import that takes over 30 seconds to complete. I tried the following and have not been able to resolve this issue:
I added ...
172
votes
6
answers
187k
views
Keyword not supported: "data source" initializing Entity Framework Context
I'm initializing Entity Framework Object context, and this gives me the keyword not supported error:
metadata=res://*/MainDB.csdl|res://*/MainDB.ssdl|res://*/MainDB.msl;provider=System.Data.SqlClient;...
130
votes
5
answers
130k
views
How should I edit an Entity Framework connection string?
I recently had to edit my app.config file to change the connection string for an Entity Framework data model (.edmx file). But I'd like to know: Is there a way to edit the EF connection string using ...
94
votes
9
answers
176k
views
keyword not supported data source
I have an ASP.NET MVC application with the default membership database. I am accessing it by ADO.NET Entity Framework.
Now I want to move it to IIS, but several problems showed up. I had to install ...
89
votes
13
answers
153k
views
Entity Framework change connection at runtime
I have a web API project which references my model and DAL assemblies. The user is presented with a login screen, where he can select different databases.
I build the connection string as follows:
...
89
votes
4
answers
72k
views
The connection string 'MyConnection' in the application's configuration file does not contain the required providerName attribute."
I use Entity Framework Code First,
My connection string is in a configuration file:
<connectionStrings>
<clear/>
<add name="ApplicationServices" connectionString="Data Source=...
41
votes
10
answers
51k
views
How to configure ProviderManifestToken for EF Code First
I have a asp.net MVC3 project using EF code-first. For my unit testing I have been using SQL Server CE 4.0 and SQL Server 2008 Express. Both have worked perfectly with EF generating my database as ...
40
votes
1
answer
80k
views
SQL Server Express connection string for Entity Framework Code First
I am working in Visual Web Developer 2010 Express, and using the Entity Framework code-first CTP. I am able to do this with the new SQL Server CE but I am unable to find a connection string to work ...
36
votes
2
answers
39k
views
Why does an Entity Framework Connection require a metadata property?
I switched my DAL from using LINQ over to Entity Framework. Because my application connects to different databases depending on the current user, I need to dynamically create the DataContext at run ...
34
votes
9
answers
63k
views
Keyword not supported: 'server'
I've been trying to edit my connection string for uploading my website to a server.
I am not really experienced with this. I got this exception: the Keyword not supported: 'server'.
Here is my ...
34
votes
2
answers
15k
views
What does App=EntityFramework do in Sql connection string?
I have 2 connection strings - 1 local and 1 for my main production server. Entity Framework added App=EntityFramework to my local string when I installed it (4.1) - I'm now on 4.3. What does this do - ...
34
votes
8
answers
30k
views
Get SqlConnection from DbConnection
I have an Extension method on DbContext where I want to do a SqlBulkCopy. Therefore I need a SqlConnection. The connection from the DbContext is from the type DbConnection though.
Among a few other ...
33
votes
6
answers
44k
views
No context type was found in the assembly
I'm using .NET 4.0, MVC3, and EF5 with code first.
My solution is split up into three projects, with the dependencies as indicated:
Project.Web -> Project.BLL -> Project.DAL
The Project.DAL layer ...
33
votes
2
answers
31k
views
Entity Framework Code First and Connection String Issue
I am getting this error when using Entity Framework 4.1 code first. I can not find any sources of what exactly to use.
Unable to load the specified metadata resource.
<add name="DataContext" ...
33
votes
3
answers
18k
views
EF 5 Changing Connection String at Runtime
Ok, I want to recreate a project that I created using EF 4.1 to EF 5.0, simple enough or at least I thought. One of the things in my old project is that I was able to change the database connection ...
30
votes
5
answers
18k
views
How do I set an ADO.NET Entity Framework connection string via the Windows Azure (Preview) Management Portal?
In the Windows Azure (Preview) Management Portal you can change the configuration options for web sites (see http://www.windowsazure.com/en-us/manage/services/web-sites/how-to-configure-websites/#...
24
votes
7
answers
40k
views
EntityFramework code-first custom connection string and migrations
When I create a context with a default connection string (as read from the app.config) the database is created and the migrations work - basically everything is in order. Whereas when the connection ...
19
votes
2
answers
19k
views
unable to retrieve metadata for unrecognized element providers
I get a message error whenever I try to add a controller with Entity framework template but I keep getting a error message
unable to retrieve metadata for 'path' unrecognized element providers.
...
18
votes
1
answer
9k
views
Wait! which config file? (Entity Framework Connection String)
So, I created my entity model in a separate class library. I had to add the connection string to the app.config file of that class library. Then I added a ref for that project in my web application. I ...
15
votes
2
answers
9k
views
Code first migrations - what connection string will it use?
Code first migrations have been working very well for me. I have a services project and a wpf project. The model is in the services project which is referenced by the wpf project. Update-database ...
15
votes
2
answers
27k
views
Entity Framework: "ProviderName" in connection string required- all of the sudden?
We've been using Entity framework in a production environment for many months now, and just yesterday started to get errors on some machines when querying the database using our subclass of DbContext:
...
14
votes
1
answer
9k
views
Multipleactiveresultsets in Entity Framework 4.1 Code First
This is my first EF project so bear with me please.
When updating an entity such as Department, you pull it from the context, update its values and call context.SaveChanges. However, if you update ...
14
votes
2
answers
7k
views
How to get provider specific ConnectionString from Entity Framework
using ado.net tipically we need to define a connectionstring to create a sqlconnection object, and if we use the entity framework, we have to dedine a connectionstring too.
is threre any way to get ...
12
votes
5
answers
16k
views
Overriding code-generated DbContext constructor
I'm sure I've done this before at some stage, but I can't figure out how to now! My scenario:
// This is generated from EDMX
public partial class HOLDbEntities : DbContext
{
public HOLDbEntities()...
11
votes
2
answers
7k
views
Docker SQL-Server login problem: AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback
I'm working on a Docker related application, written in C#, based on Entity Framework.
One of the Docker containers, is the ms-sql-server, which is used for database access.
In order to access the SQL-...
10
votes
2
answers
4k
views
Entity Framework 6 Programmatically Connect to Postgres
I'm working on programmatically establishing a connection to PostgresSQL using Entity Framework 6. I have this class:
public class ClearspanDatabaseContext : DbContext
with this constructor:
public ...
10
votes
2
answers
7k
views
Autogenerated default connection string vs. manually added one
Let's say I have got simple WPF application using Entity Framework Code First to create database, connect to it and display some data. From start I do not want to worry about connection strings so ...
10
votes
7
answers
42k
views
An error occurred while getting provider information from the database
Getting the error:
System.Data.ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect ...
10
votes
3
answers
5k
views
Single Connection String with Multiple Entity Framework Models?
At work we currently have a very large web application with a connection to a massive database. We have been using Entity Framework for a while now and to make things easier we divided the database ...
10
votes
1
answer
15k
views
Entity Framework cant use the DbContext, model being created
I am using EF 4.1, and I create a normal EF edmx file.
I generate it from a DB.
When it's been generated I rightclick and select add code generation item, to generate new classes, and use the ...
10
votes
3
answers
3k
views
Can't connect to SQL Azure from app, but can from SSMS
I have a SQL Azure instance set up and can connect to it with no issue from SQL Server Management Studio. However when my app tries to connect, this error occurs:
A network-related or instance-...
9
votes
2
answers
9k
views
Using a separate file to maintain the connection string for entity framework
I have my connection string currently in my web.config file.
Is it possible to place it in a separate file and point entity framework to it.
9
votes
3
answers
21k
views
Entity Framework with Microsoft Access
I use .accdb file. I created class
using System.Data.Entity;
class MSADbContext:DbContext
{
public DbSet<Product> Products { get; set; }
}
and add connectionString
<...
9
votes
2
answers
6k
views
Apostrophe (single quote) in connection string
I'm having a trouble with the ' character in a connection string. Entity Framework throws an exception saying:
Format of the initialization string does not conform to specification starting at ...
9
votes
5
answers
5k
views
NLog with an Entity Framework connection string?
I'm trying to use the 'Database' NLog target and would like NLog to read my connection string to avoid having to set it twice in the same config file. The problem is I have an Entity Framework-style ...
9
votes
1
answer
5k
views
SQL Azure EF Database First Connection String in Azure Management Portal
I have a site running n Azure, which uses EF Database First model.
If I embed the connection string in the web.config and deploy all is rosy.
<add name="MyEntities" connectionString="metadata=res:...
9
votes
4
answers
4k
views
c# - Entity Framework ConnectionString won't update after changing App.Config in runtime
I'm developing a WPF application which depends on Entity Framework for data access.
At the first time installation I need to create a new connection string based on the User input, then updating App....
9
votes
1
answer
25k
views
Setting ConnectionTimeout when using EntityFramework
I would like to set the ConnectionTimeout to something other than the default, which is 15 seconds. I have inherited some code that uses EntityFramework and the app.config looks like this:
<...
9
votes
0
answers
8k
views
A null was returned after calling the 'get_ProviderFactory' method on a store provider instance of type 'Oracle.DataAccess.Client.OracleConnection
I am using Entity Framework 4.4 code first(Factory Pattern) to get data from existing Oracle view. Here is my entity class:
class Data
{
[Required]
[StringLength(50)]
public String ...
8
votes
1
answer
5k
views
EF 5.0 & dynamic connection string?
One thing is driving me crazy right now.
My (Database-first) EF-Model needs a dynamic connection string (IP-Adress of Server might change once in a while).
So in older EF-Versions you could pass a ...
8
votes
2
answers
19k
views
EDMX connection string
so the story is like this.
I have a project, called PA.DLL, which have an entity model inside of it (edmx) file.
In another project which i'm referencing to the PA.DLL, i copied the connection ...
8
votes
4
answers
5k
views
Azure Website Exception: Format of the initialization string does not conform to specification starting at index 0
I have an Azure Website that I use to host my MVC + Entity Framework project. When I run the site locally using the same connection to my SQL Azure database, everything works perfectly, but when I ...
8
votes
3
answers
5k
views
What is the purpose of ApplicationServices connection string in Entity Framework Code First scenario?
Whenever you create an application using EF code first you can see follwing web.config key added:
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=...
8
votes
3
answers
1k
views
Error : No connection string in application config file... but there is one
I have the following error when I try to build my solution:
No connection string named 'TechnicalAnalyzerEntities' could be found
in the application config file.
The thing is that :
1/ there ...
8
votes
2
answers
10k
views
A network-releated or instance-specific error occurred while establishing a connection to SQL Server
I have a simple mvc web site (using the VS internet template) on azurewebsites talking to a SQL Azure database in the same data center. The database at this time is just to do the built-in ...
7
votes
2
answers
9k
views
How to get database information with entityframework database first?
When I use Entity Framework codefirst I can use the following code to get my database connection string:
var db = new dbContext();
Console.Writeline(db.Database.Connection.ConnectionString);
But ...
7
votes
4
answers
18k
views
SQL Server Compact 4.0 connection string for Entity Framework code first?
I am creating an application for Windows XP so I am stuck with .Net framework 4.0. I tried to use SQL Server Compact and EF code first but it make an error when update-database.
I wish to put the ...
7
votes
2
answers
21k
views
How to get ConnectionString from Secrets.json in Asp.Net Core 6?
I am new to Asp.Net Core and EF. I am developing a simple CRUD from database-end, using the Secrets.json file to hide my connection string credentials.
But I don't know how to reference the file using ...
7
votes
1
answer
9k
views
Keyword not supported: 'data source' in ASP.net Entity Framework 6
I've been poking my brain around for a few days trying to figure this out.
I'm using winhost to host a SQL Server and I've looked up quite a few similar questions with the same issue but they all ...
7
votes
4
answers
4k
views
Entity Framework Code First ignoring connection string, using IIS instead
I have a web app that I've created using Entity Framework Code First. In setting it up I have managed to match my DB connection string to my DBContext by specifying the full namespace and class of the ...