connection-string

encrypt SQL connectionstring c#

折月煮酒 提交于 2019-12-17 07:31:19
问题 I created an c# application (not asp webpage) which connects to a sql 2005 server. In my sourcecode the password and userid for this sql-server is coded plain text in ConnectionString. SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=server1;"+ "Initial Catalog=mydatabase;"+ "Integrated Security=no;"+ "User ID=admin;Password=mypassword;"; con.Open(); Is there a easy way to encrypt password or whole connectionstring, that other peoples who disassemble my tool are

encrypt SQL connectionstring c#

梦想的初衷 提交于 2019-12-17 07:31:04
问题 I created an c# application (not asp webpage) which connects to a sql 2005 server. In my sourcecode the password and userid for this sql-server is coded plain text in ConnectionString. SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=server1;"+ "Initial Catalog=mydatabase;"+ "Integrated Security=no;"+ "User ID=admin;Password=mypassword;"; con.Open(); Is there a easy way to encrypt password or whole connectionstring, that other peoples who disassemble my tool are

Default Schema in Oracle Connection URL

爱⌒轻易说出口 提交于 2019-12-17 07:21:09
问题 I'd like to set default database schema in Oracle Connection URL jdbc:oracle:thin:@<server>:<port1521>:<sid> My sample SQL statement: select monkey_name from animals.monkey I need to query database without schema prefix animals. i.e. when I run this statement select monkey_name from monkey it will use animals schema by default. What do I need to specify in connection URL above get such effect? Thanks. 回答1: You can't put anything in the connection URL. In Oracle each user has their own schema

How to find SQL Server running port?

一笑奈何 提交于 2019-12-17 07:01:47
问题 Yes I read this How to find the port for MS SQL Server 2008? no luck. telnet 1433 returns connection failed, so I must specify other port. I tried to use netstat -abn but I don't see sqlservr.exe or something similar on this list. Why it so difficult to find that port? :/ 回答1: Try this: USE master GO xp_readerrorlog 0, 1, N'Server is listening on' GO http://www.mssqltips.com/sqlservertip/2495/identify-sql-server-tcp-ip-port-being-used/ 回答2: very simple. make a note of the sqlsrvr.exe PID from

Format of the initialization string does not conform to specification starting at index 0

吃可爱长大的小学妹 提交于 2019-12-17 06:53:53
问题 I have an ASP.Net MVC application which runs fine on my local development machine. But when deployed to IIS7 gives the following error when trying to log in: Format of the initialization string does not conform to specification starting at index 0 Most people who post this error resolve it by changing their connection string in some way. However my connection string on the local and deployed application are the same. The connection string is like this: <add name="ApplicationServices"

Format of the initialization string does not conform to specification starting at index 0

人盡茶涼 提交于 2019-12-17 06:53:36
问题 I have an ASP.Net MVC application which runs fine on my local development machine. But when deployed to IIS7 gives the following error when trying to log in: Format of the initialization string does not conform to specification starting at index 0 Most people who post this error resolve it by changing their connection string in some way. However my connection string on the local and deployed application are the same. The connection string is like this: <add name="ApplicationServices"

Format of the initialization string does not conform to specification starting at index 0

心不动则不痛 提交于 2019-12-17 06:53:26
问题 I have an ASP.Net MVC application which runs fine on my local development machine. But when deployed to IIS7 gives the following error when trying to log in: Format of the initialization string does not conform to specification starting at index 0 Most people who post this error resolve it by changing their connection string in some way. However my connection string on the local and deployed application are the same. The connection string is like this: <add name="ApplicationServices"

How do I use Web.Config transform on my connection strings?

落花浮王杯 提交于 2019-12-17 06:12:19
问题 In my current project, I have some connection strings that are valid for local development machines: <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI" </connectionStrings> .... </configuration> How would I use the Web.Config transforms to convert from this expression to one valid for our production server? The production server one would look something like: <configuration>

How to read connection string in .NET Core?

梦想的初衷 提交于 2019-12-17 04:49:29
问题 I want to read just a connection string from a configuration file and for this add a file with the name "appsettings.json" to my project and add this content on it: { "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet- WebApplica71d622;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } } } On ASP.NET I used this: var temp

Writing a connection string when password contains special characters

混江龙づ霸主 提交于 2019-12-17 04:32:14
问题 I'm using SQLalchemy for a Python project, and I want to have a tidy connection string to access my database. So for example: engine = create_engine('postgres://user:pass@host/database') The problem is my password contains a sequence of special characters that get interpreted as delimiters when I try to connect. I realize I could just create an object and then pass my credentials like this: drivername = 'postgres', username = 'user', password = 'pass', host = 'host', database = 'database' But