ADO.NET Multiple connection strings Unable to locate a Local DatabaseEntity Framework defaultconnectionfactoryHow to concatenate text from multiple rows into a single text string in SQL server?referencing edmx in mvc projectUnable to connect to the Local Server with Integrated Seurity = TrueService-based Database connection stringEntity Framework Seeding with SqlCeBulkCopy returns errorCreate Hybrid connection (Azure), access sql database from another computerFormat of the initialization string does not conform to specification starting at index 0 : no new solutionEntity Framework database connection does not reconnectConnecting to local SQL Server database from C# projectHow do I define the PROVIDER NAME in Configurations on IIS server?

Extract the characters before last colon

Filter a data-frame and add a new column according to the given condition

Substring join or additional table, which is faster?

Were any toxic metals used in the International Space Station?

Why can't I share a one use code with anyone else?

Show solution to recurrence is never a square

How about space ziplines

Is Valonqar prophecy unfulfilled?

Was this seat-belt sign activation standard procedure?

Should generated documentation be stored in a Git repository?

Offered a new position but unknown about salary?

Do Grothendieck universes matter for an algebraic geometer?

the grammar about `adv adv` as 'too quickly'

The meaning of the Middle English word “king”

How can we allow remote players to effectively interact with a physical tabletop battle-map?

Why are solar panels kept tilted?

White foam around tubeless tires

Who commanded or executed this action in Game of Thrones S8E5?

"The van's really booking"

Was the dragon prowess intentionally downplayed in S08E04?

Promotion comes with unexpected 24/7/365 on-call

Alias for root of a polynomial

Unexpected Netflix account registered to my Gmail address - any way it could be a hack attempt?

Were any of the books mentioned in this scene from the movie Hackers real?



ADO.NET Multiple connection strings Unable to locate a Local Database


Entity Framework defaultconnectionfactoryHow to concatenate text from multiple rows into a single text string in SQL server?referencing edmx in mvc projectUnable to connect to the Local Server with Integrated Seurity = TrueService-based Database connection stringEntity Framework Seeding with SqlCeBulkCopy returns errorCreate Hybrid connection (Azure), access sql database from another computerFormat of the initialization string does not conform to specification starting at index 0 : no new solutionEntity Framework database connection does not reconnectConnecting to local SQL Server database from C# projectHow do I define the PROVIDER NAME in Configurations on IIS server?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I use to run site with one database, but now we expanded with new features on 2nd database. Im suddenly getting exceptions like this, im not sure if its related to connection strings, can someone more experienced in this give me a clue.



NOTE: Users can connect normaly, but after session expire im getting this in logs:




A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 52 - Unable to locate a Local Database
Runtime installation. Verify that SQL Server Express is properly
installed and that the Local Database Runtime feature is enabled.)




Inner exception :




System.ComponentModel.Win32Exception (0x80004005): The system cannot
find the file specified




I run site with 2 connection strings, like below:



 <connectionStrings>
<add name="db_entity1" connectionString="metadata=res://*/Models.AliModel.csdl|res://*/Models.AliModel.ssdl|res://*/Models.AliModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.6;initial catalog=dbname;user id=dbusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="db_ProductionEntities" connectionString="metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.2;initial catalog=maindatabasename;user id=databaseusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>


db_ProductionEntities Is my default connection to which users connect to website (this is where usernames are and emails). 2nd connection is just for new features.










share|improve this question
























  • I suggest you include an obfuscated version of your actual connection strings in your question.

    – Dan Guzman
    Mar 23 at 14:48












  • sure, I added it

    – user3399805
    Mar 23 at 14:54











  • could it be that in defaultConnectionFactory i need to add full connection string instead "mssqllocaldb" ?

    – user3399805
    Mar 23 at 14:56












  • According to this answer, defaultConnectionFactory is only used when no connection string is provided for the context. But the error clearly indicates it's using localDb.

    – Dan Guzman
    Mar 23 at 15:04











  • i dont user local db anywhere

    – user3399805
    Mar 23 at 20:48

















0















I use to run site with one database, but now we expanded with new features on 2nd database. Im suddenly getting exceptions like this, im not sure if its related to connection strings, can someone more experienced in this give me a clue.



NOTE: Users can connect normaly, but after session expire im getting this in logs:




A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 52 - Unable to locate a Local Database
Runtime installation. Verify that SQL Server Express is properly
installed and that the Local Database Runtime feature is enabled.)




Inner exception :




System.ComponentModel.Win32Exception (0x80004005): The system cannot
find the file specified




I run site with 2 connection strings, like below:



 <connectionStrings>
<add name="db_entity1" connectionString="metadata=res://*/Models.AliModel.csdl|res://*/Models.AliModel.ssdl|res://*/Models.AliModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.6;initial catalog=dbname;user id=dbusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="db_ProductionEntities" connectionString="metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.2;initial catalog=maindatabasename;user id=databaseusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>


db_ProductionEntities Is my default connection to which users connect to website (this is where usernames are and emails). 2nd connection is just for new features.










share|improve this question
























  • I suggest you include an obfuscated version of your actual connection strings in your question.

    – Dan Guzman
    Mar 23 at 14:48












  • sure, I added it

    – user3399805
    Mar 23 at 14:54











  • could it be that in defaultConnectionFactory i need to add full connection string instead "mssqllocaldb" ?

    – user3399805
    Mar 23 at 14:56












  • According to this answer, defaultConnectionFactory is only used when no connection string is provided for the context. But the error clearly indicates it's using localDb.

    – Dan Guzman
    Mar 23 at 15:04











  • i dont user local db anywhere

    – user3399805
    Mar 23 at 20:48













0












0








0








I use to run site with one database, but now we expanded with new features on 2nd database. Im suddenly getting exceptions like this, im not sure if its related to connection strings, can someone more experienced in this give me a clue.



NOTE: Users can connect normaly, but after session expire im getting this in logs:




A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 52 - Unable to locate a Local Database
Runtime installation. Verify that SQL Server Express is properly
installed and that the Local Database Runtime feature is enabled.)




Inner exception :




System.ComponentModel.Win32Exception (0x80004005): The system cannot
find the file specified




I run site with 2 connection strings, like below:



 <connectionStrings>
<add name="db_entity1" connectionString="metadata=res://*/Models.AliModel.csdl|res://*/Models.AliModel.ssdl|res://*/Models.AliModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.6;initial catalog=dbname;user id=dbusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="db_ProductionEntities" connectionString="metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.2;initial catalog=maindatabasename;user id=databaseusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>


db_ProductionEntities Is my default connection to which users connect to website (this is where usernames are and emails). 2nd connection is just for new features.










share|improve this question
















I use to run site with one database, but now we expanded with new features on 2nd database. Im suddenly getting exceptions like this, im not sure if its related to connection strings, can someone more experienced in this give me a clue.



NOTE: Users can connect normaly, but after session expire im getting this in logs:




A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 52 - Unable to locate a Local Database
Runtime installation. Verify that SQL Server Express is properly
installed and that the Local Database Runtime feature is enabled.)




Inner exception :




System.ComponentModel.Win32Exception (0x80004005): The system cannot
find the file specified




I run site with 2 connection strings, like below:



 <connectionStrings>
<add name="db_entity1" connectionString="metadata=res://*/Models.AliModel.csdl|res://*/Models.AliModel.ssdl|res://*/Models.AliModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.6;initial catalog=dbname;user id=dbusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="db_ProductionEntities" connectionString="metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=192.168.200.2;initial catalog=maindatabasename;user id=databaseusername;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>


db_ProductionEntities Is my default connection to which users connect to website (this is where usernames are and emails). 2nd connection is just for new features.







sql-server entity-framework ado.net






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 14:53







user3399805

















asked Mar 23 at 14:43









user3399805user3399805

16




16












  • I suggest you include an obfuscated version of your actual connection strings in your question.

    – Dan Guzman
    Mar 23 at 14:48












  • sure, I added it

    – user3399805
    Mar 23 at 14:54











  • could it be that in defaultConnectionFactory i need to add full connection string instead "mssqllocaldb" ?

    – user3399805
    Mar 23 at 14:56












  • According to this answer, defaultConnectionFactory is only used when no connection string is provided for the context. But the error clearly indicates it's using localDb.

    – Dan Guzman
    Mar 23 at 15:04











  • i dont user local db anywhere

    – user3399805
    Mar 23 at 20:48

















  • I suggest you include an obfuscated version of your actual connection strings in your question.

    – Dan Guzman
    Mar 23 at 14:48












  • sure, I added it

    – user3399805
    Mar 23 at 14:54











  • could it be that in defaultConnectionFactory i need to add full connection string instead "mssqllocaldb" ?

    – user3399805
    Mar 23 at 14:56












  • According to this answer, defaultConnectionFactory is only used when no connection string is provided for the context. But the error clearly indicates it's using localDb.

    – Dan Guzman
    Mar 23 at 15:04











  • i dont user local db anywhere

    – user3399805
    Mar 23 at 20:48
















I suggest you include an obfuscated version of your actual connection strings in your question.

– Dan Guzman
Mar 23 at 14:48






I suggest you include an obfuscated version of your actual connection strings in your question.

– Dan Guzman
Mar 23 at 14:48














sure, I added it

– user3399805
Mar 23 at 14:54





sure, I added it

– user3399805
Mar 23 at 14:54













could it be that in defaultConnectionFactory i need to add full connection string instead "mssqllocaldb" ?

– user3399805
Mar 23 at 14:56






could it be that in defaultConnectionFactory i need to add full connection string instead "mssqllocaldb" ?

– user3399805
Mar 23 at 14:56














According to this answer, defaultConnectionFactory is only used when no connection string is provided for the context. But the error clearly indicates it's using localDb.

– Dan Guzman
Mar 23 at 15:04





According to this answer, defaultConnectionFactory is only used when no connection string is provided for the context. But the error clearly indicates it's using localDb.

– Dan Guzman
Mar 23 at 15:04













i dont user local db anywhere

– user3399805
Mar 23 at 20:48





i dont user local db anywhere

– user3399805
Mar 23 at 20:48












1 Answer
1






active

oldest

votes


















0














Remove the defaultConnectionfactory setting






share|improve this answer























  • I tried that, error still happens

    – user3399805
    Mar 23 at 20:40











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314890%2fado-net-multiple-connection-strings-unable-to-locate-a-local-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Remove the defaultConnectionfactory setting






share|improve this answer























  • I tried that, error still happens

    – user3399805
    Mar 23 at 20:40















0














Remove the defaultConnectionfactory setting






share|improve this answer























  • I tried that, error still happens

    – user3399805
    Mar 23 at 20:40













0












0








0







Remove the defaultConnectionfactory setting






share|improve this answer













Remove the defaultConnectionfactory setting







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 23 at 15:02









ErikEJErikEJ

32.1k34987




32.1k34987












  • I tried that, error still happens

    – user3399805
    Mar 23 at 20:40

















  • I tried that, error still happens

    – user3399805
    Mar 23 at 20:40
















I tried that, error still happens

– user3399805
Mar 23 at 20:40





I tried that, error still happens

– user3399805
Mar 23 at 20:40



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314890%2fado-net-multiple-connection-strings-unable-to-locate-a-local-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript