Top "Sqlconnection" questions

Represents an open connection to a SQL Server database.

Most efficient way to test SQL connection string availibility

I have this code down which I tried to make it Test SQL string connectivity, but I dont know how …

c# sql sql-server sqlconnection
ExecuteReader requires an open and available Connection. The connection's current state is closed

Ok, I asked about this very error earlier this week and had some very helpful answers and without doubt things …

sql sqldatareader sqlconnection
sql connection string using sql authentication

I am using this sql connection string : string connection = "data source=OSBORNECHARLES2;initial catalog=TWO; integrated security=False;User ID=…

c# sql-server sqlconnection
C# connect to database and list the databases

Possible Duplicate: SQL Server query to find all current database names I am trying to figure out how to list …

c# sql database ado.net sqlconnection
Unrecognized escape sequence in SqlConnection constructor

when ever I make connection it gives an error Unrecognized escape sequence. NEPOLEON\ADMN HERE ON THIS SLASH. NEPOLEON\ADMN …

c# sqlconnection
Is it better to execute many sql commands with one connection, or reconnect every time?

Here's my test code, which seems to suggest that it's better to connect multiple times instead of connecting just once. …

c# .net sql-server performance sqlconnection
Does SqlCommand.Dispose close the connection?

Can I use this approach efficiently? using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString)) { cmd.Connection.Open(); // set …

.net garbage-collection dispose sqlconnection sqlcommand
Do I have to Close() a SQLConnection before it gets disposed?

Per my other question here about Disposable objects, should we call Close() before the end of a using block? using (…

c# asp.net using sqlconnection sqlcommand
C# DbConnection cast to SqlConnection

I found this piece of code in one application Database database = DatabaseFactory.CreateDatabase("connection string"); DbConnection connection = database.CreateConnection(); connection.…

c# sqlconnection
Should I be using SqlDataReader inside a "using" statement?

Which of the following two examples are correct? (Or which one is better and should I use) In the MSDN …

c# .net ado.net sqlconnection