connection-string

Connection String to Connect to .MDF

我的未来我决定 提交于 2019-12-17 19:18:09
问题 I've created a new project in VS2008, and added a .MDF file to the project. This is the first time I've tried to use the MDF files and .SQLEXPRESS databases (I've always used extenal Oracle servers in the past). I'm trying to document everything as I go, but I can't figure out what credentials are being used to connect to the .MDF file. Is there an easy way to find out? 回答1: If you're using the *.mdf file in the App_Data folder of an ASP.NET app you can use this. Server=.\SQLExpress

SQL Server: Modifying the “Application Name” property for auditing purposes

你离开我真会死。 提交于 2019-12-17 18:24:09
问题 As we do not implement the users of our applications as users in SQL server, when the application server connects to a database each application always uses the same credentials to attach to each database. This presents an auditing problem. Using triggers, we want to store every update, insert and delete and attribute each to a particular user. One possible solution is to add an "updated by user" column to every table and update this every time. This means a new column on every table and a

Quick ways to test OLE DB Connection String

最后都变了- 提交于 2019-12-17 17:39:15
问题 For debugging purpose I'd like to know ways to test OLE DB connection string quickly. I've found this free software, it works on my machine, tested successfully. Is there a even quicker way to do so, maybe from command line on Windows? Because most of the time, it is the client rather than me that would do this task, so I prefer a "zero-installation" approach that would impact their system the least. 回答1: If the client has PowerShell installed (a given if they are running Windows 7 or Windows

Using a relative path in connection string for Access DB in C#

▼魔方 西西 提交于 2019-12-17 17:01:58
问题 I'm trying to get this line in my web.config file to use a relative path instead of hardcoded one, but nothing seems to be working. I can only find stuff for SQL and mySQL DBs <connectionStrings> <add name="dbConnection" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Mike\Desktop\GeauxEat NEW\GeauxEat\App_Data\GeauxEatAccessDB.accdb"/> </connectionStrings> I tried making it <add name="dbConnection" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|Data

“Server” vs “Data Source” in connection string

半世苍凉 提交于 2019-12-17 15:53:08
问题 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? 回答1: 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

SQLite EF6 programmatically set connection string at runtime

折月煮酒 提交于 2019-12-17 15:37:48
问题 I try to migrate form EF 3.5 to 6 (with SQLite as database). We can not set the connection string in the app config file (this works without problems with ef6). We have to set connection string programmatically at runtime (after user has selected the SQLite file). Here is our app.config <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name=

Setting the SQL connection string for ASP.NET Core web app in Azure

随声附和 提交于 2019-12-17 10:56:28
问题 I have created a new ASP.NET Core web application in Visual Studio 2015. I've also set up an Azure web app to pull in the app from GitHub and run it. This works fine, but I'm having trouble connecting to the database on Azure. Locally, this works, and it uses config.json and in code Data:DefaultConnection:ConnectionString for the connection string. How can I leave the code as it is, and have it work in Azure too? I've tried setting the Application Settings in the portal, both the Connection

Encrypting connectionStrings section - utility for app.config

。_饼干妹妹 提交于 2019-12-17 09:33:45
问题 Is there a utility that will encrypt a named configuration section (or just the connectionStrings section) in an app.config file in a similar manner that one can use aspnet_regiis with web.config files? I know this can be done in code - there are code examples out there, but I am hoping to avoid writing an application for this. 回答1: You can try the following: https://magenic.com/thinking/encrypting-configuration-sections-in-net In short - rename the app.config file to web.config - the schema

Possible to set default schema from connection string?

[亡魂溺海] 提交于 2019-12-17 07:42:08
问题 With SQL Server 2005 and 2008 is it possible to set the default schema from the connection string? It'd be a lot easier if we didn't have to manually set the schema with SQL code. 回答1: No, this is done at the database User level, not in the connection string. For reference, here are all of the properties which can be set in a connection string: https://www.connectionstrings.com/all-sql-server-connection-string-keywords/ 回答2: You set the default schema based on the user who is logging in via

Possible to set default schema from connection string?

做~自己de王妃 提交于 2019-12-17 07:42:04
问题 With SQL Server 2005 and 2008 is it possible to set the default schema from the connection string? It'd be a lot easier if we didn't have to manually set the schema with SQL code. 回答1: No, this is done at the database User level, not in the connection string. For reference, here are all of the properties which can be set in a connection string: https://www.connectionstrings.com/all-sql-server-connection-string-keywords/ 回答2: You set the default schema based on the user who is logging in via