SQL providerName in web.config

System.Data.SqlClient is the .NET Framework Data Provider for SQL Server. ie .NET library for SQL Server. I don’t know where providerName=SqlServer comes from. Could you be getting this confused with the provider keyword in your connection string? (I know I was 🙂 ) In the web.config you should have the System.Data.SqlClient as the value of … Read more

Quick ways to test OLE DB Connection String

The following method has proven useful for me. It’s super quick and practical and doesn’t require PowerShell: Open up Notepad and create an empty text file, then click File -> click Save -> and save it with the File name: TestConnection.udl to your desktop. Go to your desktop and double-click on the TestConnection.udl file you … Read more

How to fix “The ConnectionString property has not been initialized”

Referencing the connection string should be done as such: MySQLHelper.ExecuteNonQuery( ConfigurationManager.ConnectionStrings[“MyDB”].ConnectionString, CommandType.Text, sqlQuery, sqlParams); ConfigurationManager.AppSettings[“ConnectionString”] would be looking in the AppSettings for something named ConnectionString, which it would not find. This is why your error message indicated the “ConnectionString” property has not been initialized, because it is looking for an initialized property of AppSettings named … Read more

How to handle special characters in the password of a Postgresql URL connection string?

See Connection URIs in the doc. There are a few things that don’t seem quite right in your question: URIs are supported by postgres since version 9.2 only, so with a 9.1 client that’s not supposed to work at all. Or you’re using a client that implements connection URIs itself. Percent-sign encoding is supported. Per … Read more

How do I set a connection string config programmatically in .net?

I’ve written about this in a post on my blog. The trick is to use reflection to poke values in as a way to get access to the non-public fields (and methods). eg. var settings = ConfigurationManager.ConnectionStrings[ 0 ]; var fi = typeof( ConfigurationElement ).GetField( “_bReadOnly”, BindingFlags.Instance | BindingFlags.NonPublic ); fi.SetValue(settings, false); settings.ConnectionString = “Data … Read more

Create a jTDS connection string

As detailed in the jTDS Frequenlty Asked Questions, the URL format for jTDS is: jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;…]] So, to connect to a database called “Blog” hosted by a MS SQL Server running on MYPC, you may end up with something like this: jdbc:jtds:sqlserver://MYPC:1433/Blog;instance=SQLEXPRESS;user=sa;password=s3cr3t Or, if you prefer to use getConnection(url, “sa”, “s3cr3t”): jdbc:jtds:sqlserver://MYPC:1433/Blog;instance=SQLEXPRESS EDIT: Regarding your Connection … Read more

What is the connection string for localdb for version 11

Requires .NET framework 4 updated to at least 4.0.2. If you have 4.0.2, then you should have HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319\SKUs.NETFramework,Version=v4.0.2 If you have installed latest VS 2012 chances are that you already have 4.0.2. Just verify first. Next you need to have an instance of LocalDb. By default you have an instance whose name is a single … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)