src/Misc/EFTools/EntityDesign/VisualStudio/VsUtils.cs
// <summary>
//     Checks to see if the connection string is pointing to a database file and if so, calls SqlConnection.ClearAllPools()
//     to release any read lock on the database file.
// </summary>
Checks to see if the connection string is pointing to a database file and if so, calls SqlConnection.ClearAllPools()
to release any read lock on the database file.
Checks to see if the connection string is pointing to a database file and if so calls SqlConnection . ClearAllPools () to release any read lock on the database file .
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        internal static void SafeCloseDbConnectionOnFile(string designTimeProviderName, string designTimeConnectionString)
        {
            try
            {
                if (LocalDataUtil.IsLocalDbFileConnectionString(designTimeProviderName, designTimeConnectionString))
                {
                    SqlConnection.ClearAllPools();
                }
            }
            catch
            {
            }
        }
[ SuppressMessage ( " " , " " ) ] internal static void SafeCloseDbConnectionOnFile ( string designTimeProviderName , string designTimeConnectionString ) { try { if ( LocalDataUtil . IsLocalDbFileConnectionString ( designTimeProviderName , designTimeConnectionString ) ) { SqlConnection . ClearAllPools ( ) ; } } catch { } }
Checks to see if the connection string is pointing to a database file and if so, calls SqlConnection.ClearAllPools()
to release any read lock on the database file.
Checks to see if the connection string is pointing to a database file and if so calls SqlConnection . ClearAllPools () to release any read lock on the database file .
// Even though this is for the general case, let's cleanup SqlConnection appropriately.
designTimeProviderName
string
designTimeConnectionString
string