connection-string

Connect SQL Server on button click VB.net

本秂侑毒 提交于 2020-01-03 03:45:10
问题 How to connect SQL Server on button click? I want to manually enter the Server, Username and Password into textboxes. I have a code here but I'm not sure if it's correct. Private Sub SQLConnect_Click(sender As Object, e As EventArgs) Handles SQLConnect.Click Dim con As SqlConnection = New SqlConnection("Server=" & SQLServer.Text & ";Database=GameDB;User Id=" & SQLUser.Text & ";Password=" & SQLPwd.Text & ";") con.Open() MsgBox("Successfully Connected!") 'con.Close() End Sub Idk how to check if

C# Modify Connection String that exists inside a library

谁说我不能喝 提交于 2020-01-03 02:01:32
问题 I have a Class Library, which inside just has a DataSet (MySQL connector) and a Connector class. I use this class in multiple projects to connect to the database, and I always had the password embedded in the connection string but now I need to be able to modify this string(for security purposes) so I can have the user connect using their own account. How can I modify this connection string. I have tried the following Properties.Settings.Default.DataBaseConnectionString = "String"; But it

Entity Framework 6 - Npgsql - connection string error

邮差的信 提交于 2020-01-03 01:41:13
问题 A tricky (and frustrating problem) - perhaps you folks may be clever enough to solve it: Problem I want to be able to read/write to my database using Entity Frameworks. I have got a simple app rails running on Heroku (straightforward scaffold). I want to connect to this database and manipulate records. The good news is that I can successfully connect to that database using npgsql. The bad news is that I cannot do it with Entity Frameworks. This is the error I’m receiving: System.Data.Entity

Localdb in Visual Studio 2015 error 52 (SQL Server)

ぐ巨炮叔叔 提交于 2020-01-02 23:54:38
问题 I programmed an application with an attached .mdf database file that works fine on my computer. But on another computer (client PC) I get this error message : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database

Two hosts in jdbc url

久未见 提交于 2020-01-02 15:46:52
问题 We are using jdbc url like jdbc:mysql://localhost:3306/mysql . How could I set second mysql host in this url? If this is imposible, how could I set in my java application (hibernate) connection to second MySQL server? Thanks! PS. actually we want to parallelize operations to two different databases. Is there any solution for that in Hibernate? 回答1: This is really about failover/clustering. jdbc:mysql://192.168.29.20:3306,192.168.29.20:6306/mysql should do it. see http://lists.mysql.com

Configure NHibernate hibernate.cfg.xml file to have more connection strings

自古美人都是妖i 提交于 2020-01-02 09:55:01
问题 My client asked the posibility to switch from a c# app from the "CURRENT" database to a TEST database or DEV database. Only one can be active at a time. In a menu file she choose DEV or TEST database. How do I configure hibernate.cfg.xml file to have more connection strings like app.config. <name="CURRENT" connectionString='User Id=u1;Data Source=CURRENT;Password=...' /> <name="DEV" connectionString='User Id=u1;Data Source=DEV;Password=...' /> <name="TEST" connectionString='User Id=u1;Data

C# ConfigurationManager retrieves wrong connection string from app.config

a 夏天 提交于 2020-01-02 07:06:16
问题 I have a simple WinForms app that will eventually be a game. Right now, I'm just working on the data access layer of it and I've run into a snag. I created a separate project called DataAccess and inside of that, I created a local .mdf SQL Server database file. I also created an app.config file to store the connections string. Here's that config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="TBG_Master" connectionString="Data Source=(localdb)

ADO - how to select column from xls file where two or more columns have the same name?

故事扮演 提交于 2020-01-02 06:23:11
问题 I have an excel file like this: | | A | B | C | D | | 1 | Name 1 | Name 2 | Name 3 | Name 2 | | 2 | Data | Data | Data | Data | | 3 | Data | Data | Data | Data | As you can see, headers of two columns have the same name - Name 2 . My question is, is it possible to tell the ADO engine from which column to select data? Currently my select looks like this: SELECT [Name 1], [Name 2] FROM [REPORT7_RAW$] WHERE [Name 1] IS NOT NULL and ADO picks up the data from column which is listed under column B

Azure does not override application settings

萝らか妹 提交于 2020-01-02 05:32:27
问题 In my Azure App Service I want to update application settings, but after publish from VS the keys doesn't override values from local Web.config In Azure it looks like: In the result my web.config on azure contains values from local settings <connectionStrings> <add name="MainConnectionString" connectionString="ConnectionStringToReplaceByAzure" providerName="System.Data.SqlClient" /> </connectionStrings> <appSettings> <add key="MS_SigningKey" value="Overridden by portal settings" /> <

Connection string for Informix for .NET

亡梦爱人 提交于 2020-01-01 19:17:49
问题 We are using an Informix database, and are connecting to it from .NET sucessfully using ODBC. The connection string we are using is; DRIVER={IBM INFORMIX ODBC RIVER}; UID=username; PWD=password; DATABASE=our_database; HOST=devsrv01; SERVER=devsrv01_tcp; SERVICE=ids9tcp2; PROTOCOL=onsoctcp; CLIENT_LOCALE=en_US.CP1252; DB_LOCALE=en_US.819; We want to change from ODBC and use IBM's SDK and libraries as outlined on their site. The code we are using is; string ConnectionString = "Database=our