Necessity of explicit cursor.close()

Django’s cursor class is just a wrapper around the underlying DB’s cursor, so the effect of leaving the cursor open is basically tied to the underlying DB driver. According to psycopg2’s (psycopg2 is DB driver Django uses for PostgreSQL DB’s) FAQ, their cursors are lightweight, but will cache the data being returned from queries you … Read more

PostgreSQL: Warning: Console code page (437) differs from Windows code page (1252)

From the psql documentation: psql is built as a “console application”. Since the Windows console windows use a different encoding than the rest of the system, you must take special care when using 8-bit characters within psql. If psql detects a problematic console code page, it will warn you at startup. To change the console … Read more

A network-related or instance-specific error occurred while establishing a connection to SQL Server [closed]

Sql Server fire this error when your application don’t have enough rights to access the database. there are several reason about this error . To fix this error you should follow the following instruction. Try to connect sql server from your server using management studio . if you use windows authentication to connect sql server … 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