RSS
 

Archive for the ‘.Net Framework’ Category

Deep Look @ConnectionString.. Connection Pooling

05 Jul

In terms of processing and Inter-Process Communication (IPC), it is quite expensive to create a connection to a data source. You can see this if you step through any code that creates an initial data source connection—there is a significant delay while the network channel is opened, handshaking with the server occurs, a connection to the SQL Server is made, and user credentials are authenticated. This process is true even with the most simple connection—more complex connections that include transactions or the attaching of database files take even longer.

Inside an application, it would be unusual to find that a different type of connection or data source location is required for each database operation. Perhaps, then, it would make sense if, instead of the connection being destroyed after each operation, it could be reused to save the expense of opening a new connection? Connection pooling performs this connection optimization.

If the connection string values match between connection requests and an existing connection exists in the connection pool, ADO.NET reuses the existing connection instead of creating a new connection. Different connection pools are created based upon differing connection string values, transactions, and Integrated Security identity. It is good practice— and strongly recommended—that you close the Connection object after each operation so it can be returned to the connection pool.

The good news is that connection pooling is enabled by default and in most cases does not require any configuration to suit your requirements

A persistent connection is one which, once opened, remains available for use until it is closed explicitly after performing all required database operations. To do this, connection pooling must be disabled. This is configured by setting Pooling=false in the connection string

From: ADO.Net MCTS Certification book

 

Deep Look @SQLDataSource

25 Jun
 

Assembly Qualified Name…Get It

30 Apr

before we start to know how we can get the qualified name of the assembly, let’s define first assembly ”Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality“ and assembly content

Assembly Content

then let’s define Global Assembly Cache :The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. Now, we can write code using reflection to can get the Fully Qualified Name of assembly”

public static void Main(){
        Type t = typeof(System.Data.DataSet);
        string s = t.Assembly.FullName.ToString();
        Console.WriteLine("The fully qualified name {0}.", s); }
My Source: http://msdn.microsoft.com/en-us/default.aspx
 
 
 
 

You need to log in to vote

The blog owner requires users to be logged in to be able to vote for this post.

Alternatively, if you do not have an account yet you can create one here.

Powered by Vote It Up