connection-string

Duplicate Connection String Error

瘦欲@ 提交于 2019-12-08 08:08:01
问题 I have a website deployed in a server. One day it threw an error saying the connection string name is already added. I checked the web.config file and it has only one entry in that name. I removed the entry from the config. Now the website worked well and fetched data from database. Note: When I changed the name of the config file it show error. I think, the issue is – the connectionstring part is cached in memory. Is it so? How can we overcome this unwanted behavior? Config Files in Source

read ConnectionString from appsettings.json for entity.Framework

浪子不回头ぞ 提交于 2019-12-08 07:32:50
问题 i try to read a ConnectiongString from appsettings.json for entityFramework and MySQL, but i get the error: System.ArgumentNullException: Value cannot be null. Parameter name: connectionString this is my appsetings.json: { "Data": { "ConnectionStrings": { "DefaultConnection": "server=database;userid=hawai;pwd=mysecret;port=3306;database=identity;sslmode=none;", "MigrationConnection": "server=127.0.0.1;userid=hawai;pwd=mysecret;port=3306;database=identity;sslmode=none;" } } } this is my

SQL Compact 2008 Connection String Problem

微笑、不失礼 提交于 2019-12-08 05:43:47
问题 I have the following code to connect to a sql server compact edition 2008: private SqlConnection sqlConn; public void createConnection() { String connectionString = @"Data Source=C:\Projects\somefile.sdf;Persist Security Info=False"; sqlConn = new SqlConnection(connectionString); sqlConn.Open(); } However, I keep getting the following error when sqlConn.Open() is executed: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not

Connection string for SQL Server Express on remote Computer login failed error

☆樱花仙子☆ 提交于 2019-12-08 05:28:45
问题 I recently asked the question at this address: Remote SQL Server connection string That thread has helped us arrive at this connection string: SqlConnection connection= new SqlConnection("Server=2.221.1.145;Database=Database;User Id=Andy-PC\\Andy;Password=mypass"); This throws the error: Login failed for user 'Andy-PC\Andy' This user owns the database and i guess should have access to it....however I remember when trying this style of authentication locally it did not work - which is why I

how to connect to access 2007 with c#

夙愿已清 提交于 2019-12-08 04:32:03
问题 hey, i am new at connecting to dataBases and for some reason each time i use those following lines my program collapse: string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;DataSource=|DataDirectory|\Company.accdb" OleDbConnection con = new OleDbConnection(connectionString); inside my debug folder i got Company.accdb access file edit: i am getting 'Microsoft.Ace.OLEDB12.0' provider is not registered on the local machine any idea how to solve it? thanks in advance for your help 回答1:

The underlying provider failed on Open in entity framework connection

左心房为你撑大大i 提交于 2019-12-08 04:23:30
问题 i use Entity framework in .net 4 and use this connection in project: <add name="Database1Entities" connectionString="metadata=res://*/Model.Model1.csdl|res://*/Model.Model1.ssdl|res://*/Model.Model1.msl;provider=System.Data.SqlClient;pr ovider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Database1.mdf;initial catalog=Database1;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> and show this

Need ServiceConfiguration.cscfg to populate web.config sessionstate and connection strings

你说的曾经没有我的故事 提交于 2019-12-08 03:31:25
问题 I need to propagate connection string changes for entity framework, asp.net membership (which are both in the connectionstrings section of web.config) and session state (which is in sessonstate's sqlconnectionstring) in web.config when I adjust these settings in windows azure's service configuration. During development we test our app as a standard asp.net webforms app, but once it is deployed it is running in azure. So we need to allow for the site running in both non-azure and an azure

How to use encrypted connection string on app.config with Dataset.xsd generated by Wizard on Windows Form

隐身守侯 提交于 2019-12-08 02:53:51
问题 I'm developing an MDI application with Visual Studio 2013 (.NET 4.5) and Oracle Developer Tools latest release. I need to create a main form that then will be the container for many different forms, each of which will be a different application. The application have to connect to different Oracle databases and now I'm trying to set the main form to keep all the connection strings encrypted and possibly on a separate file. For now the connection string is only one. To encrypt the connection

Accessing SQL Server using an IP Address and Port Number … Help!

折月煮酒 提交于 2019-12-08 02:38:15
问题 I need to access an SQL Server that is on a machine behind a firewall and you access this machine using an ip address like 95.95.95.33:6930 (not the real ip address) ... But, you get my point that by accessing 95.95.95.33 on port 6930, the firewall routes the requests to that particular machine ... My question is ... How do you construct a connection string to access the machine at address 95.95.95.33:6930 and then further access the SQL Server on port 1433 or maybe a different port like 8484

ConnectionString management for many projects on one server, should I make my own ConnectionString provider for our code

你。 提交于 2019-12-08 01:22:37
问题 I have on a single Windows Server about 10 different .NET projects, mostly .NET 4.0 but some .NET 2.0 Some of these projects are asp.net, some are background utilities/services. These projects interact with over a hundred different databases in our infrastructure. The ConnectionStrings they use to do that changes at least a few times a month. The issue here is that forgetting to put a ConnectionString in one of these projects can cause a lot of problems, and new projects/updates are deployed