connection-string

Connection String in web.config fails to connect

╄→尐↘猪︶ㄣ 提交于 2019-12-11 01:59:57
问题 I decided to transfer my project from work to home and I am having some trouble with the connection to the database. This one works on work: web.config: <connectionStrings> <add name="ApplicationServices" connectionString="Data Source=XXXXXX\SQLSERVER2008;Persist Security Info=true;Initial Catalog=esResearch;User ID=XXXXXX; Password=XXXXXX" providerName="System.Data.SqlClient" /> <add name="esResearchConnectionString" connectionString="Data Source=XXXXXX\SQLSERVER2008;Initial Catalog

Specify the active connection string to use in Web.Config

徘徊边缘 提交于 2019-12-11 01:55:38
问题 Is there a quick and easy way to set a connection string in Web.Config to be the active connection string? I basically want to name my connection strings appropriately and then set one as active without having to switch out the names or re-compile my application. Something like this: <add name="Current" connectionString="{Local}"/> <add name="Local" connectionString=[...]" /> <add name="RemoteOnMyServer" connectionString=[...]" /> <add name="RemoteAzure" connectionString=[...]" /> 回答1: I don

Is there a way to store connection strings in a central location other than machine.config

喜你入骨 提交于 2019-12-11 01:21:48
问题 I am currently trying to ease the configuration hell that exists on our client-servers. We have something like 8 applications who each have their own connection string info, and we were hoping to store connection strings in a central location to make our poor support team's life easier. However, I have been asked to avoid doing this in machine.config because (1) we are frequently not the only third party on servers at client sites and apparently (this concern shouldn't matter as long as we

How to set a proper connection string for Azure database?

爱⌒轻易说出口 提交于 2019-12-11 00:29:14
问题 I have an azure website and database. I'm running an ASP.NET MVC 4 / EF 5 app localy and trying to put some data to the azure database before to deploy the app. But I have a TargetInvocationException : {"The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588"} Keyword not supported : server This is the connection string that I get from my azure dashboard : <add name="myconstring" connectionString=Server

Is it safe to write connection string in web.config?

这一生的挚爱 提交于 2019-12-10 22:03:05
问题 Is it safe to write connection string in web.config in an ASP.net application. The application will be using 2 databases and I think the connection string can be retrieved easily. Can anyone please suggest a secure place(web.config or other file) for writting the connection string except encrypting it. 回答1: Web.config is the right place for this. You can encrypt the connection string if that's a concern for you. Encrypting the connection string in Web.config it's already supported in ASP.NET

Can the provider connection string of Entity Framework be substituted with a DB connection string already defined in web.config?

会有一股神秘感。 提交于 2019-12-10 21:21:43
问题 I have a db connection string 'ApplicationServices' defined in the connectionString section of web.config and 3 Entity Framework connection strings which have the provider connection string attribute with the same connection string as the one in 'ApplicationServices'. Is there a way to reference connectionString in 'ApplicationServices' for the provider connection string attribute of the EF connection string in the web.config, rather than providing the connection string all over again? This

The connection to the host server failed. Java

回眸只為那壹抹淺笑 提交于 2019-12-10 20:38:58
问题 I'm trying to run a query but I keep getting this error: The connection to the host server=localhost, named instance sqlexpress failed. Error: "java.net.UnknownHostException: server=localhost". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host. Any ideas? Here's my code. public static void main(String[] args) { try { try { // TODO code application

The 'data source' keyword is not supported. (ASP.Net app, Entity-framework 5, Code first, migrations)

≯℡__Kan透↙ 提交于 2019-12-10 19:59:48
问题 I have an OData/WCF Data Services endpoint (ASP.Net site) that I would like to switch from using EF Code first datamodel with SQL Server 2012 as backend to EF Code first datamodel with LocalDB as backend - on our dev machines using Visual Studio 2012. Code is placed in TFS and we share the code between 5-6 developers. Existing unit tests run smoothly after switching to LocalDB. The config for the unit test project is this: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections

“Data connections” in azure

蓝咒 提交于 2019-12-10 19:41:58
问题 I have a question about "Data connections" in azure. I have an App Service. I published my API app there. In my app I have connection strings (I need to work with databases). Among numerous settings for my app I saw a "Data connections" item: There you can add new connection (server, login, password). After creation you can look at connection string for this connection: My questions are: 1. what does it do? (I mean in my app I already have a connection string in Web.config and is there any

How to enable reading C# Excel files on IIS (reading them locally on the machine where IIS is running works fine)?

两盒软妹~` 提交于 2019-12-10 19:33:13
问题 Got a problem with reading Excel files in C# The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. , same for 'Microsoft.ACE.OLEDB.12.0' . that only occurs when I run my app on IIS. Running it locally on the machine where IIS is running works fine. The machine in question runs on Win2003 R2 Enterprise x64. I develop in VS2010, ASP.Net 4.0. It looks like there are 2 types of solutions to this problem: either install something (preferred) or switch to 32bit mode. I'd