connection-string

asp.net / MySQL: Access denied for user ''@'localhost' (using password: NO)

自闭症网瘾萝莉.ら 提交于 2019-12-01 13:22:13
I'm a web dev rookie and I'm hoping someone with more experience can help sort this out. I was ambushed by a MySQL upgrade. Background: I have two XP PCs (let's ambitiously call them "web server" and "MySQL server"). I recently built and successfully hosted an asp.net site that drew data from the MySQL db. It's just a site designed for a few local users so they don't have to learn SQL to get data...nothing fancy. So far so good. Problem: This week I installed MySQL on the "web server", and that's when things went crazy. There had been no instance of MySQL on the web server before that point.

Is it possible to modify configuration ConnectionStrings at runtime?

人走茶凉 提交于 2019-12-01 12:14:19
Is it possible to modify the connectionstrings defined in the app.config/web.config at runtime? I want to use different configfiles depending on the machine the app/site is run on (only for debugging purposes, of course. We'll use the regular config files when deployed). I can write AppSettings, but not ConnectionStrings (AFAIK). Or can I? Yes it's possible, but AFAIK only via Reflection. The following code should do what you need (read below for usage): public static string SetConnectionString(Type assemblyMember, Type settingsClass, string newConnectionString, string connectionStringKey) {

Set Entity Framework connection string at runtime

旧时模样 提交于 2019-12-01 11:47:36
问题 I have generated entity model from AdventureWorks database; now I want to delete the connection string in app.config and set it at runtime. In the Model1.Context.cs file I have chnaged the constructor to public AdventureWorksEntities(string str) : base("name=AdventureWorksEntities") { this.Database.Connection.ConnectionString = str; } and in the program.cs file EntityConnectionStringBuilder ecsb = new EntityConnectionStringBuilder(); ecsb.Metadata = @"res://*/Model1.csdl|res://*/Model1.ssdl

Is it possible to modify configuration ConnectionStrings at runtime?

[亡魂溺海] 提交于 2019-12-01 11:36:50
问题 Is it possible to modify the connectionstrings defined in the app.config/web.config at runtime? I want to use different configfiles depending on the machine the app/site is run on (only for debugging purposes, of course. We'll use the regular config files when deployed). I can write AppSettings, but not ConnectionStrings (AFAIK). Or can I? 回答1: Yes it's possible, but AFAIK only via Reflection. The following code should do what you need (read below for usage): public static string

Where should I place my database connection string and how do I handle connection pooling?

我的梦境 提交于 2019-12-01 11:09:47
I am developing an asp.net application which I have hosted on an IIS server. To open a connection I use: SqlConnection con = new SqlConnection("Server = INLD50045747A\\SQLEXPRESS; Database = MyDatabase;User ID = sa; Password = Welcome1; Trusted_Connection = False;"); con.Open(); Is it possible to store this connection string somewhere so that I don't need to write in every aspx.cs file? I am using MSSQL database. I'm facing an issue which says: The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max

Database connection string and collation

六眼飞鱼酱① 提交于 2019-12-01 08:53:27
问题 Is it possible to set connection collation within MySql connection string and how, since there's a default setting on the server that's used for new connections. Two things I can't do : Can't call SET COLLATION_CONNECTION after I open a connection, because I'm using Entity Framework that does all the calls for me not entirely true as you may see in the edit Can't change server default connection collation because of other databases and their respected applications that use them. All I'd like

Select into table in another database that is password protected?

▼魔方 西西 提交于 2019-12-01 08:47:59
In Microsoft Access 2003 and Visual Basic 6 I'm trying to copy a table to another access database that is password protected like this... Select * INTO table2 IN 'database2.mdb' [;Password=TestPass] From table1 It fails with error : Not a valid password Does the Select INTO format not accept the password with the mdb, and the password has to be in a connection string? If not, how do you reference a different connection string/database? thanks How about: SELECT * INTO Table2 IN '' [MS Access;PWD=TestPass;DATABASE=C:\Docs\database2.mdb] FROM Table1 These days I would be more inclined to use

Changing SQL connection information for DSN-less Access frontend

百般思念 提交于 2019-12-01 08:08:01
I've got a mission-critical Access 2003 database that changed from a local MDB, to an MDB frontend with the backend on MS SQL Server 2005, using the Microsoft SQL Server Database Migration Assistant (SSMA) software. Now, I need to permanently change the server that the tables are linked to from an IP address (which is changing soon) to a hostname pointing to the same server. The server itself is not changing, just the connection string. It's a DSN-less connection, so the ODBC info is contained within the Access MDB file. If I try to refresh the table links within Access, it prompts me for a

Select into table in another database that is password protected?

为君一笑 提交于 2019-12-01 07:15:28
问题 In Microsoft Access 2003 and Visual Basic 6 I'm trying to copy a table to another access database that is password protected like this... Select * INTO table2 IN 'database2.mdb' [;Password=TestPass] From table1 It fails with error : Not a valid password Does the Select INTO format not accept the password with the mdb, and the password has to be in a connection string? If not, how do you reference a different connection string/database? thanks 回答1: How about: SELECT * INTO Table2 IN '' [MS

Changing SQL connection information for DSN-less Access frontend

混江龙づ霸主 提交于 2019-12-01 07:12:18
问题 I've got a mission-critical Access 2003 database that changed from a local MDB, to an MDB frontend with the backend on MS SQL Server 2005, using the Microsoft SQL Server Database Migration Assistant (SSMA) software. Now, I need to permanently change the server that the tables are linked to from an IP address (which is changing soon) to a hostname pointing to the same server. The server itself is not changing, just the connection string. It's a DSN-less connection, so the ODBC info is