score:3
I'm guessing that you are keeping DataContexts around and not calling Dispose on them when done (or leaving them around, at least).
Rather, you should initialize your DataContext, perform your operation, and then dispose of it when done. You shouldn't hold a reference to it between operations.
Preferably, you would use the using statement for handling the call to IDisposable.
Regarding connection pooling, the SqlClient pools connections by default, so unless you explicitly turn it off, you should be taking advantage of it already. Of course, if you aren't releasing connections you are using, then pooling will only take you so far.
Source: stackoverflow.com
Related Query
- How are people unit testing code that uses Linq to SQL
- LINQ Source Code Available
- How to code the partial extensions that Linq to SQL autogenerates?
- Determine the source DataContext for a Linq to Sql query
- How to get SQL query into LINQ form in C# code
- Multiple Database connections in a LINQ to SQL DataContext
- creating Linq to sqlite dbml from DbLinq source code
- Does LINQ convert code to SQL queries
- How do i convert this linq code to inline sql
- Reuse Linq to SQL code with entityframework
- Identify source of linq to sql query
- Linq to sql as object data source - designer problem with partial classes
- SQL subquery result in LINQ and Entity Framework Code First
- Accessing SQL Server time in code with LINQ
- Linq to sql query: how to prevent duplication of code
- convert linq to object query to sql query (no linq to sql code or datacontext)
- Linq to SQL connections
- Linq union all equivalent of sql code
- Translating Linq Code Block into SQL
- source code for LINQ 101 samples
- What SQL query or LINQ code would get the following data?
- Convert SQL code to linq (LIKE, SELECT)
- Does Linq in Entity Framework code first use SQL or does it get the whole table first?
- My Linq to Sql Insert code seems to work fine but I don't get a record in the database
- Convert SQL update query to c# LINQ code
- Equivalent C# LINQ code for SQL
- how to translate a linq expression into sql string use c# code
- Linq to SQL Source in Microsoft ReferenceSource
- Optimise and speed up very slow Linq / SQL code
- Linq to sql code for contains
More Query from same tag
- Extracting the First (Oldest) Value from Dataset Based on Column Value
- Call LINQ Query within If Condition in C#/WPF
- Select first unique child
- linq create average from different columns
- EF orderby / thenby combo extension method
- LINQ query to Group, Sort and SumProduct
- Returning a nested generic Expression<Func<T, bool>>
- Migration from NHibernate to Entity Framework 4.1?
- VB.net event handler abort when it is fired again
- Combine duplicate selections into a single result
- LINQ - Add static text to each result
- Easy way to refactor table and column names in a Linq .DBML file?
- Linq return null for no results
- Converting data from one class to another
- LINQ. Why full load only the first time?
- Find a string in a list of strings with reflection
- Use Multiple Linq queries in each other
- LINQ update on joined collections
- C# Join Clause with association table
- Dynamic lambda for Where method in linq
- LINQ check for duplicates in nested collection
- What is faster in finding element with property of maximum value
- Casting to custom type, Enumerable.Cast<T> and the as keyword
- XML.Linq - get value based on another value
- Swap Attribute in each item in a list c#
- Creating a List<string> off of one of List<Object>'s string properties
- LINQ sum with grouping, but also get line item value before grouping
- reading a empty cell, gives object reference error
- How to select rows based on column values?
- Find matched directories using a list of regular expressions