Top "Sqlconnection" questions

Represents an open connection to a SQL Server database.

Check if SQL Connection is Open or Closed

How do you check if it is open or closed I was using if (SQLOperator.SQLCONNECTION.State.Equals("Open")) however, …

c# ado.net sqlconnection
SQL Server returns error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." in Windows application

An application that has been working without problem (and has not had any active development done on it in about 6 …

sql-server security sqlconnection
How to write connection string in web.config file and read from it?

I'm trying to write Connection string to Web.config like this: <connectionStrings> <add name="Dbconnection" connectionString="Server=…

c# asp.net sqlconnection
How to run multiple SQL commands in a single SQL connection?

I am creating a project in which I need to run 2-3 SQL commands in a single SQL connection. Here …

c# sql-server ado.net sqlconnection sqlcommand
in a "using" block is a SqlConnection closed on return or exception?

First question: Say I have using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); string storedProc = "GetData"; SqlCommand command = new SqlCommand(…

c# using sqlconnection
How to use the ConfigurationManager.AppSettings

I've never used the "appSettings" before. How do you configure this in C# to use with a SqlConnection, this is …

c# asp.net sql sqlconnection
Changing SqlConnection timeout

I am trying to override the default SqlConnection timeout of 15 seconds and am getting an error saying that the property …

c# .net sql-server sqlconnection
"open/close" SqlConnection or keep open?

I have my business-logic implemented in simple static classes with static methods. Each of these methods opens/closes SQL connection …

c# sqlconnection
What is the difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout?

Is there any difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout in .NET?

.net sqlconnection sqlcommand
"Login failed for user" C# with SQLConnection

I've been trying to connect to my database (which is on the same computer as my code) through my C# …

c# sql database sqlconnection