connection-string

Oracle connection string without tnsnames.ora file

狂风中的少年 提交于 2019-11-27 13:07:13
问题 I am using the .NET framework with the System.Data.OracleClient namespace. I have the oracle 11 client installed on my computer. I do not want to use the tnsnames.ora file to store connection information. Could someone please tell me what the connection string would look like if I did not want to use the tnsnames.ora file? I will be storing the connection string in a web.config file of a Web Application Project. 回答1: http://www.connectionstrings.com/oracle This is a great resource SERVER=

Connection String Best Practices [closed]

三世轮回 提交于 2019-11-27 13:02:03
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . What is the best way to manage connection strings in a web application, from a security standpoint? I've done it several different ways. I've stored them as plain text web.config setting keys. I've also created a "Constants" class that has public read-only string properties for

Get ConnectionString from appsettings.json instead of being hardcoded in .NET Core 2.0 App

怎甘沉沦 提交于 2019-11-27 11:54:05
I have the following class in NET Core2.0 App. // required when local database does not exist or was deleted public class ToDoContextFactory : IDesignTimeDbContextFactory<AppContext> { public AppContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder<AppContext>(); builder.UseSqlServer("Server=localhost;Database=DbName;Trusted_Connection=True;MultipleActiveResultSets=true"); return new AppContext(builder.Options); } } This is required in Core 2.0 with migration when Database does not exist and has to be created when you run update-database . Unable to create

The connection string 'MyConnection' in the application's configuration file does not contain the required providerName attribute."

為{幸葍}努か 提交于 2019-11-27 11:24:34
问题 I use Entity Framework Code First , My connection string is in a configuration file: <connectionStrings> <clear/> <add name="ApplicationServices" connectionString="Data Source=PC-X;Initial Catalog=MYdb;Integrated Security=True"/> </connectionStrings> When I try to access the data (something that should create the DB) is falling with the following error: The connection string 'ApplicationServices' in the application's configuration file does not contain the required providerName attribute."

Point to localhost\sqlexpress using only localhost

断了今生、忘了曾经 提交于 2019-11-27 10:20:17
问题 Working on a common codebase, one developer is running SQL Server Express 2005 and the other 2 are running SQL Server 2005. Everything is working fine, but the connection strings differ. To maintain common configuration and build scripts we're looking to mask "localhost\sqlexpress" to just "localhost" like the other 2 developers. Can this be done? Or, maybe there's a better way for all 3 to run on the same connection string... The solution sought is for all 3 to be able to run on the same

Unable to create connectionstring for a remote desktop for a C# application

廉价感情. 提交于 2019-11-27 08:47:15
问题 I want to create a Windows service which will copy data from one database to another database. The source database is in a remote location, below is the function using SqlConnectionStringBuilder and creating the connection string: public string CreateConnectionString() { SqlConnectionStringBuilder b = new SqlConnectionStringBuilder(); b.DataSource = "ABCKOL-BCKOFF\\SQLEXPRESS"; b.InitialCatalog = "netXs"; b.IntegratedSecurity = false; b.UserID = "userid"; b.Password = "password"; return

Keyword not supported: 'server'

主宰稳场 提交于 2019-11-27 08:36:25
I've been trying to edit my connection string for uploading my website to a server. I am not really experienced with this. I got this exception: the Keyword not supported: 'server'. Here is my connection string: <add name="AlBayanEntities" connectionString="Server=xx.xx.xxx.xxx,xxxx;Database=AlBayan;Uid=bayan;Password=xxxxx;" providerName="System.Data.EntityClient" /> I've tried embed this string into my old connection string which works very well locally, but it didn't fit : S For Entity Framework (database-first or model-first; when you have a physical EDMX model file) you need to use a

Encrypting connectionStrings section - utility for app.config

随声附和 提交于 2019-11-27 07:49:33
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. RBZ 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 is identical, so aspnet_regiis works. Rename back to app.config when finished. Old question, but here is

What is the point of “Initial Catalog” in a SQL Server connection string?

做~自己de王妃 提交于 2019-11-27 07:02:07
Every SQL Server connection string I ever see looks something like this: Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database; Integrated Security=SSPI; Do I need the Initial Catalog setting? (Apparently not, since the app I'm working on appears to work without it.) Well, then, what's it for? If the user name that is in the connection string has access to more then one database you have to specify the database you want the connection string to connect to. If your user has only one database available then you are correct that it doesn't matter. But it is good practice to put

Retrieve and use Windows Azure's connection strings?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 06:48:33
问题 I've configured connection strings in Azure management portal Configure->Connection Strings (linked resources): What are these connection strings useful for? I tried deleting the conn. strings from web.config file, so it should read from here, but it doesn't. Is there any other way? Basically I want these connection strings to override the connection strings in web.config to be used in production environment. I've added the following to the Application_Start method: var sb = new StringBuilder