Obtain a nonpooled connection : SqlConnection : ADO.Net C# Examples


C# Examples » ADO.Net » SqlConnection »

 

Obtain a nonpooled connection









    
using  System;
using  System.Data.SqlClient;

class  MainClass
{
        public  static  void  Main()
        {
                        
                        using  (SqlConnection  con  =  new  SqlConnection())
                        {
                                //  Configure  the  SqlConnection  object's  connection  string.
                                con.ConnectionString  =
                                        @"Data  Source  =  .\sqlexpress;"  +//local  SQL  Server  instance
                                        "Database  =  Northwind;"  +              //the  sample  Northwind  DB
                                        "Integrated  Security  =  SSPI;"  +  //integrated  Windows  security
                                        "Pooling  =  False";                            //specify  nonpooled  connection
        
                                con.Open();
                        }
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo ADO.Net
» SqlConnection