An open connection to a SQL Server database.
[Visual Basic] Shared Public Property Connection As SqlConnection [C#] public static SqlConnection Connection { get; set; } [C++] public: static __property SqlConnection* get_Connection(); public: static __property void set_Connection(SqlConnection* ); [JScript] public static function get Connection() : SqlConnection public static function set Connection(SqlConnection);
Set this property to omit passing a SqlConnection object into each query method. If this property is unset, the SqlConnection object MUST be passed into each query method.
The SqlConnection can be either opened or closed. If the SqlConnection is closed, after the query is run, it will be closed again. The SqlConnection will remain open if it is open prior to the query running.