connection-string

Connection string for SQL Server 2014 Express (VBA)

江枫思渺然 提交于 2019-11-30 15:59:12
问题 I am trying figure out what needs to go in the connection string for SQL server via VBA. This is the code I have right now, Sub ConnectSqlServer() Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim sConnString As String ' Create the connection string. sConnString = "Provider=SQLOLEDB;Data Source=INSTANCE\SQLEXPRESS;" & _ "Initial Catalog=MyDatabaseName;" & _ "Integrated Security=SSPI;" ' Create the Connection and Recordset objects. Set conn = New ADODB.Connection Set rs = New ADODB

How to connect to mysql from C# over SSH

江枫思渺然 提交于 2019-11-30 15:08:30
问题 How can I connect to a mysql database trough C#, This is my connection string now: connectionString="server=localhost;port=3306;user id=root;Password=*****;database=Data" providerName="MySql.Data.MySqlClient" How to put SSH string in this form as it needs to be something like: SSH Hostname, SSH Username, SSH password, Mysql Hostname, Mysql Username, Mysql Password, Port 回答1: I don't think MySql and the MySqlClient support such a thing. The connection string is specifically for the database.

A network-releated or instance-specific error occurred while establishing a connection to SQL Server

回眸只為那壹抹淺笑 提交于 2019-11-30 15:07:06
问题 I have a simple mvc web site (using the VS internet template) on azurewebsites talking to a SQL Azure database in the same data center. The database at this time is just to do the built-in SimpleMembership Provider. I have already switched from the default App_Data mdf file to Azure SQL. It works fine, but sometimes after a while, it would give: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.

Pre-login handshake woes with connecting directly to SQL Azure

末鹿安然 提交于 2019-11-30 15:01:20
问题 We are currently experiencing a rather troublesome problem in our development environment with the following message... A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate's CN name does not match the passed value.) ...the commonly accepted wisdom to resolving this problem is to set the TrustServerCertificate portion of the connection to True . However, this does not work

Defining connectionString for remotely hosted SQL Server

依然范特西╮ 提交于 2019-11-30 14:43:45
At the moment I have the following <connectionStrings> definition in my Web.config` file: <connectionStrings> <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> </connectionStrings> I didn't write this though, so I have a feeling that it was automatically created by Visual Studio. My database is hosted on a separate server on our network, so how do I define it and the database username and password? For the sake of the example, the server

Get connection string in class library project in a solution

孤者浪人 提交于 2019-11-30 14:37:24
In my .net 4 solution, i have two different projects- an web application project and a class library project. In web application project, database connection string is in web.config file. I would like to access that connection string from class library project. Is it possible? if yes, how? If there is any better approach to get connection string, please let me know. To access it from your class library add a reference to System.Configuration then use System.Confinguration.ConfigurationManager.ConnectionStrings . It's not ideal to read this from a class library. After all, can you say that your

Different Connection Strings with Entity Framework based on Context

和自甴很熟 提交于 2019-11-30 14:25:16
问题 I have a web forms application that uses entity framework, the application is deployed on a development box, my local machine and a production box. Each of these have different connection strings. What is the best way of handling this. I use TFS Build Server to deploy to development and take the result of that build zip it and copy it to production manually. I also use Web Deployment Projects if that helps What I was doing before was when the ORM started it would choose a connection string

Secure ConnectionString in WinForm Applications

馋奶兔 提交于 2019-11-30 14:21:29
How Can I Secure my ConnectionString in WinForm Application? You can't. Although you can encrypt the connection string in the app.config file, the application needs to be able to decrypt it and it is therefore always possible to retrieve the unencrypted connection string, especially with a managed application (perhaps not for your typical end user, but any skilled developer can do this). The solution to this is to not lean on security by obscurity . Use Windows Integrated Security when connecting to the database using the Windows user account and give the user the minimum amount of rights in

How to connect to mysql from C# over SSH

一笑奈何 提交于 2019-11-30 13:47:00
How can I connect to a mysql database trough C#, This is my connection string now: connectionString="server=localhost;port=3306;user id=root;Password=*****;database=Data" providerName="MySql.Data.MySqlClient" How to put SSH string in this form as it needs to be something like: SSH Hostname, SSH Username, SSH password, Mysql Hostname, Mysql Username, Mysql Password, Port I don't think MySql and the MySqlClient support such a thing. The connection string is specifically for the database. You will need an SSH client to connect first to the SSH server and then find a way to route the Sql

Is ConfigurationManage -> section.SectionInformation.ProtectSection() machine dependent?

给你一囗甜甜゛ 提交于 2019-11-30 13:29:30
in the code Configuration config = ConfigurationManager.OpenExeConfiguration (Application.ExecutablePath); ConnectionStringsSection section = config.GetSection("connectionStrings") as ConnectionStringsSection; if (!section.SectionInformation.IsProtected) { section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); } I´m getting some trouble when I move the application to another machine. is the section.SectionInformation.ProtectSection call machine dependent, meaning, I cannot copy the config file and use it on another machine ? Is there a provider (other than