connection-string

.NET 4: How to configure EDMX file in other assembly in Web.Config

谁说我不能喝 提交于 2019-11-28 00:22:47
问题 I have a problem with configuring an EDMX file that lives in an other assembly than by web project. My project looks somewhat like this: Project 1 --> Database.edmx --> App.Config Project 2 --> Ton's of .cs and .aspx files. --> Web.Config with the proper connection string. Inside Visual Studio the updating of the .EDMX file inside Project 1 goes smoothly and while I had the .EDMX file inside project 2 the application ran as it supposed to. Anyone has an idea on how to configure the .EDMX file

Storing connection strings in machine.config vs storing them in web.config

試著忘記壹切 提交于 2019-11-28 00:02:47
For a dedicated server, is it better to store the connection string in web.config or machine.config? what's the advantages and disadvantages of each approach? Thanks Edit: I'm concerned about security here, so, the question is about which approach is more secure. I would always go with web.config on the grounds that that is where everyone would expect it to be. There is no point in giving the person that has to maintain the web site any more difficulty by storing connection strings in an unusual place. ADDITIONAL Based on the additional information that the OP is interested in the security

How to read web.config file in .Net Core app

会有一股神秘感。 提交于 2019-11-27 23:32:44
I have created a .Net Core API and I referenced a .Net framework application to it. The referenced Application connects to a data base and its connection string is stored in web.config file: string CONNSTR =ConfigurationManager.ConnectionStrings["SHOPPINGCNN"].ConnectionString; The .Net Core application uses appsettings.json instead of web.config file. When I run the API and try to use the referenced application resources, the above code will be triggered and will return null because there is no web.config file exists in .net Core app. What is the best solution to resolve this issue in .net

App.config connection string relative path

泪湿孤枕 提交于 2019-11-27 22:13:53
I need to set in the app.config the sqlite connection string. I want to set the path relative to the debug/release folders the database file will be copied to those folders. <add name="EmailsSQLite" connectionString="data source=c:\Users\Test\Documents\Visual Studio 2008\Projects\TestConsole\Emails\data\EmailDatabase.sqlite" providerName="System.Data.SQLite"/> and I want to have something like: <add name="EmailsSQLite" connectionString="data source=\data\EmailDatabase.sqlite" providerName="System.Data.SQLite"/> Is that possible? You can specify a relative path as described in Lefty's answer.

System.Data.SqlClient.SqlException: Login failed for user

我的梦境 提交于 2019-11-27 21:54:30
Working with my project in debug I have no issues. However running it in IIS I am getting this error: System.Data.SqlClient.SqlException: Login failed for user 'domain\name-PC$'. Stack Trace [SqlException (0x80131904): Login failed for user 'CAPLUGSLLC\OETINGER-PC$'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6749670 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815 System.Data.SqlClient.TdsParser.TryRun

connectionStrings configSource in App.config not working

只愿长相守 提交于 2019-11-27 21:46:22
I'm trying to separate my connection string from my App.config , and as you can't do transformations like with Web.config , I thought may I could use the configSource attribute to point to another config file with the connection string in, but it doesn't seem to be working. This works, App.config : <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=*snip*" requirePermission="false" /> </configSections>

Difference Between Persist Security Info And Integrated Security?

懵懂的女人 提交于 2019-11-27 21:19:27
In a SQL Server connection string, what's the difference between Integrated Security = True/SSPI and Persist Security = True ? Persist Security = true means that the Password used for SQL authentication is not removed from the ConnectionString property of the connection. When Integrated Security = true is used then the Persist Security is completely irelevant since it only applies to SQL authentication, not to windows/Integrated/SSPI. " Integrated Security " or "Trusted_Connection" When false , User ID and Password are specified in the connection. When true , the current Windows account

“Server” vs “Data Source” in connection string

一笑奈何 提交于 2019-11-27 20:20:31
I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works: Data Source=(localdb)\v11.0;Integrated Security=true; and Server=(localdb)\v11.0;Integrated Security=true; What exact difference is there between the two? Damien_The_Unbeliever For the full list of all of the connection string keywords, including those that are entirely synonymous, please refer to the SqlConnection.ConnectionString documentation : These are all entirely equivalent: Data Source Server Address Addr Network Address Exel Gamboa ... There

How should I edit an Entity Framework connection string?

南楼画角 提交于 2019-11-27 19:52:10
问题 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 the designer? The original connection string is auto-generated by the Entity Data Model wizard. The connection string then cannot be changed - it remains disabled in the properties window of the .edmx designer. I like to avoid editing XML by hand if I can (in app.config), so I was wondering if

No connection string named 'MyApplicationEntities' could be found in the application config file

风流意气都作罢 提交于 2019-11-27 19:36:26
I just install EF 4.3 and trying to upgrade my project with migration. however I am getting issues with trying to execute add-migration initial to my project via Package Manager console. It is throwing any exception now No connection string named 'MyApplicationEntities' could be found in the application config file. Now my config has it all <connectionStrings> <add name="MyApplicationEntities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=localhost;initial catalog