connection-string

Choosing a Connection String based on kind of request

微笑、不失礼 提交于 2019-12-12 01:36:51
问题 I used to have a web service through which a client could perform DB operations and a website could read the DB. Now, due to re-design needs, through the webservice a client can make DB operations. This DB is in workstation A. Through the same webservice, a website retrieves information from DB. This DB is in workstation B. DB in location A constantly feeds the DB in workstation B, and I need the website to display the information on workstation B. Is there any way I can have different

Easily switching ConnectionStrings on publish to Azure

痴心易碎 提交于 2019-12-12 01:32:59
问题 I'm currently building an Azure Web Role. I am testing this project against a local database server on localhost . Then, when confident that the project is working, I publish it to Staging on Windows Azure. However, I also have to remember to change the connection string to point to the live SQL server on SQL Azure before deploying, and then change it back to localhost afterwards. Is there any nice way to automate this, or perhaps a different process to take to avoid the issue altogether? For

PostgreSQL Connection String with ODBC driver in C#, Keyword not supported: driver

戏子无情 提交于 2019-12-12 01:27:40
问题 Lately I've been trying to connect a PostgreSQL 9.6 database on my C# project but I've been struggling setting up the connection string correctly due to "Keyword not supported:driver". After having read tons of information, I downloaded the ODBC.NET, I registered PostgreSQL in ODBC Data Sources (32x), referenced the Microsoft.Data.Odbc.dll in my project's directory and managed to have a successful connection with my database in the Visual Studio's Ultimate 2013, but when it came to accessing

error in mysql syntax in vb.net

若如初见. 提交于 2019-12-12 01:18:28
问题 I get this error, while I'm testing the code below: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[student](ID, LASTNAME, FIRSTNAME, SCHOOL) VALUES ('333', 'aaa', 'aaa', 'aaa')' at line 1 I just recycled the code that I used in manipulating ms sql database. So the syntax must be wrong. What might be the correct syntax for adding records into mysql database? Here is my current code: idnum = TextBox1.Text

ERROR: Unknown connection option in connection string: attachdbfilename

≯℡__Kan透↙ 提交于 2019-12-11 19:33:57
问题 Cant seem to get my connection string to work. app.config file: <add name="PalisadeWorld.Properties.Settings.PalisadeWorldDatabaseConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PalisadeWorldDatabase.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> Where I use the connection string: SqlCeConnection Con = new SqlCeConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename="C:\\Users\\Win8User\\Documents\\Visual

SQL Server conn string. w/ remote machine requires IP:PORT and SQLPORT

痞子三分冷 提交于 2019-12-11 18:34:43
问题 My problem is trying to create a connection string in C# which connects to a SQL Server 2012 database remotely. I can successfully do this if the machine hosting the SQL Server does not require a port number to navigate to. Now that we have re-routed our ip's a little, the ip to the machine hosting SQL Server is XXX.XXX.XXX.XXX:16500, where SQL Server is still listening on default port 1433. I understand you can specify the port number that the SQL Server instance is using like so; data

Ado dot netconnection String with Access 2007

旧时模样 提交于 2019-12-11 17:54:51
问题 I am trying to connect with Access 2007 "accdb" file using ADO net using the following code, but i am getting the error Unrecognized Database format , What can be the possible reason for this? OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=C:/MyWorkers.accdb"); try { conn.Open(); MessageBox.Show("Connected"); } catch (Exception ex) { MessageBox.Show(ex.Message); } 回答1: You can use the Microsoft.ACE.OLEDB.12.0 provider, see http://www

Error while Changing the connection string dynamically

最后都变了- 提交于 2019-12-11 16:21:56
问题 Im having this problem when changing my entities connection string. here is the code: SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder(); sqlBuilder.DataSource = @"KURT-PC\SQLEXPRESS"; sqlBuilder.InitialCatalog = "KurtDB"; sqlBuilder.UserID = "Admin"; sqlBuilder.Password = "123456"; sqlBuilder.IntegratedSecurity = false; sqlBuilder.MultipleActiveResultSets = true; EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder(); entityBuilder.Provider =

WPF and ADO.NET EF - error part II

 ̄綄美尐妖づ 提交于 2019-12-11 14:06:15
问题 I have added the connection string to the App.config of a main executable in my wpr, prism application and I get the following error: System.TypeInitializationException was unhandled Message=The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Logging.Logger' threw an exception. Source=Microsoft.Practices.EnterpriseLibrary.Logging TypeName=Microsoft.Practices.EnterpriseLibrary.Logging.Logger StackTrace: at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer() at

Encrypting connection strings so other devs can't decrypt, but app still has access

天涯浪子 提交于 2019-12-11 13:43:04
问题 I have a database that I want to access via a .NET web application. I can encrypt the connection string in web.config easily enough, but any developer with access to the box can decrypt it with a few lines of code - they have access to the box, so therefore have access to the encryption key stored in machine.config. While I can lock people out of the database by denying their user accounts access, it doesn't help that the web app has the proverbial keys to the kingdom. Anyone know of a good