本文整理汇总了C#中System.Data.Common.DbConnectionStringBuilder.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# DbConnectionStringBuilder.Remove方法的具体用法?C# DbConnectionStringBuilder.Remove怎么用?C# DbConnectionStringBuilder.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Common.DbConnectionStringBuilder
的用法示例。
在下文中一共展示了DbConnectionStringBuilder.Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReplaceEnlistInConnectionString
/// <summary>
/// Replaces any existing 'enlist' parameter in the connection string
/// with a value indicating that manual enlist is necessary.
/// </summary>
/// <remarks>
/// ODP.NET supports 3 values for 'enlist'; 'true', 'false' and 'dynamic'.
/// 'dynamic' effectively works the same as 'false' in System.Data.OracleClient.
/// </remarks>
protected override void ReplaceEnlistInConnectionString(DbConnectionStringBuilder dbConnectionStringBuilder)
{
if (dbConnectionStringBuilder.ContainsKey("enlist"))
dbConnectionStringBuilder.Remove("enlist");
dbConnectionStringBuilder.Add("enlist", "dynamic");
}
示例2: GetProvider
/// <summary>
/// Extracts the provider from the connection string or uses the default.
/// </summary>
/// <param name="csb">The DbConnectionStringBuilder object to use.</param>
/// <returns>the string type of the provider.</returns>
private static string GetProvider(DbConnectionStringBuilder csb)
{
string provider = "System.Data.SqlClient"; // default factory provider
if (csb.ContainsKey("provider"))
{
provider = csb["provider"].ToString();
csb.Remove("provider");
}
return provider;
}
示例3: GetConncetionString
public string GetConncetionString()
{
if(connectionStringBuilder == null)
{
var umbracoVersion = new Version(GlobalSettings.CurrentVersion);
var umbracoConnectionString = umbracoVersion.Major > 4
? ConfigurationManager.ConnectionStrings["umbracoWorkflow"].ConnectionString
: ConfigurationManager.AppSettings["umbracoWorkflow"];
connectionStringBuilder = new DbConnectionStringBuilder { ConnectionString = umbracoConnectionString };
connectionStringBuilder.Remove("datalayer");
}
return connectionStringBuilder.ConnectionString;
}
示例4: ExtractSchemaName
public static string ExtractSchemaName(this string connectionString, out string schemaName)
{
const string key = "Queue Schema";
var connectionStringParser = new DbConnectionStringBuilder
{
ConnectionString = connectionString
};
if (connectionStringParser.ContainsKey(key))
{
schemaName = (string) connectionStringParser[key];
connectionStringParser.Remove(key);
connectionString = connectionStringParser.ConnectionString;
}
else
{
schemaName = null;
}
return connectionString;
}
示例5: GetCommandTimeout
/// <summary>
/// Gets the command timeout (in seconds) from
/// the connection string (if the CommandTimeout key is specified).
/// </summary>
private static int? GetCommandTimeout(DbConnectionStringBuilder csb)
{
const string key = "CommandTimeout";
int? value = null;
if (csb.ContainsKey(key))
{
int iValue;
if (Int32.TryParse(csb[key].ToString(), out iValue))
{
// ignore negative values
if (iValue >= 0)
{
value = iValue;
}
}
csb.Remove(key);
}
return value;
}
示例6: Open
// Awesome SQL CE 4 speed improvement by Erik Ejskov Jensen - SQL CE 4 MVP
// It's not an issue with SQL CE 4 that we never close the connection
public static SqlCeConnection Open(string connectionString)
{
var connectionStringBuilder = new DbConnectionStringBuilder();
try
{
connectionStringBuilder.ConnectionString = connectionString;
}
catch (Exception ex)
{
throw new ArgumentException("Bad connection string.", "connectionString", ex);
}
connectionStringBuilder.Remove("datalayer");
// SQL CE 4 performs better when there's always a connection open in the background
EnsureOpenBackgroundConnection(connectionStringBuilder.ConnectionString);
SqlCeConnection conn = new SqlCeConnection(connectionStringBuilder.ConnectionString);
conn.Open();
return conn;
}
示例7: ReadConnectionParameters
/// <summary>
/// Initialize the Connection Parameters using the Connection String Settings
/// </summary>
/// <param name="settings"></param>
public void ReadConnectionParameters(ConnectionStringSettings settings)
{
var connectionString = new DbConnectionStringBuilder { ConnectionString = settings.ConnectionString };
if (connectionString.ContainsKey("Database"))
{
DatabaseName = (string)connectionString["Database"];
}
if (connectionString.ContainsKey("DriverClass"))
{
Connection_DriverClass = (string)connectionString["DriverClass"];
connectionString.Remove("DriverClass");
}
else
throw new ConnectionElementNotFoundException("DriverClass");
if (connectionString.ContainsKey("Dialect"))
{
Dialect = (string)connectionString["Dialect"];
connectionString.Remove("Dialect");
}
else
throw new ConnectionElementNotFoundException("Dialect");
if (connectionString.ContainsKey("proxyfactory.factory_class"))
{
ProxyFactoryClass = (string)connectionString["proxyfactory.factory_class"];
connectionString.Remove("proxyfactory.factory_class");
}
if (connectionString.ContainsKey("TablePrefix"))
{
TablePrefix = (string)connectionString["TablePrefix"];
connectionString.Remove("TablePrefix");
}
if (connectionString.ContainsKey("show_sql"))
{
ShowSql = (string)connectionString["NHibernateInterceptor"] == "true";
connectionString.Remove("show_sql");
}
if (connectionString.ContainsKey("NHibernateInterceptor"))
{
Interceptor = (string)connectionString["NHibernateInterceptor"];
connectionString.Remove("NHibernateInterceptor");
}
if (connectionString.ContainsKey("CreatedOn"))
{
FieldCreatedOn = (string)connectionString["CreatedOn"];
connectionString.Remove("CreatedOn");
}
if (connectionString.ContainsKey("UpdatedOn"))
{
FieldUpdatedOn = (string)connectionString["UpdatedOn"];
connectionString.Remove("UpdatedOn");
}
if (connectionString.ContainsKey("CreatedBy"))
{
FieldCreatedBy = (string)connectionString["CreatedBy"];
connectionString.Remove("CreatedBy");
}
if (connectionString.ContainsKey("UpdatedBy"))
{
FieldUpdatedBy = (string)connectionString["UpdatedBy"];
connectionString.Remove("UpdatedBy");
}
Connection_ConnectionString = connectionString.ConnectionString;
}
示例8: GetDatabaseInfo
protected static void GetDatabaseInfo(ref Site site, string physicalPath, string remoteComputerName)
{
try
{
string virtualSite = "/website";
var map = new WebConfigurationFileMap();
map.VirtualDirectories.Add(virtualSite, new VirtualDirectoryMapping(Environment.ExpandEnvironmentVariables(physicalPath), true));
var configuration = WebConfigurationManager.OpenMappedWebConfiguration(map, virtualSite);
if (configuration != null)
{
ConfigurationSection configSection = configuration.GetSection("connectionStrings");
if (configSection != null)
{
foreach (ConnectionStringSettings connectionStringSetting in configuration.ConnectionStrings.ConnectionStrings)
{
string name = connectionStringSetting.Name;
string providerName = connectionStringSetting.ProviderName;
string dbConnectionString = connectionStringSetting.ConnectionString;
if (string.IsNullOrEmpty(dbConnectionString))
{
continue;
}
if (dbConnectionString.Contains("metadata"))
{
// TODO: check other EF scenarios
// this is an entity framework connection string, so we can't migrate it.
// We use this to validate later on however
// we assume the site has a normal connection string as well
site.Add(new Database(providerName, name, dbConnectionString) { ParentSite = site });
continue;
}
//var builder = new SqlConnectionStringBuilder(dbConnectionString);
//if (!string.IsNullOrEmpty(builder.AttachDBFilename) && name == "LocalSqlServer")
//{
// we ignore this since it is MOST LIKELY the default values from the machine.config connection string from .NET framework
// continue;
//}
try
{
var dbConn = new DbConnectionStringBuilder { ConnectionString = dbConnectionString };
// dbConn.ConnectionString = dbConnectionString;
if (dbConn.ContainsKey("Provider") && (dbConn["Provider"].ToString() == "SQLOLEDB" || dbConn["Provider"].ToString().Contains("SQLNCLI")))
{
dbConn.Remove("Provider");
}
var sqlConn = new SqlConnectionStringBuilder(dbConn.ConnectionString);
//sqlConn.ConnectionString = dbConnectionString;
if (!string.IsNullOrEmpty(sqlConn.AttachDBFilename) && name == "LocalSqlServer")
{
// we ignore this since it is MOST LIKELY the default values from the machine.config connection string from .NET framework
continue;
}
if (!string.IsNullOrEmpty(remoteComputerName))
{
sqlConn.DataSource = SetAppropriateServerName(sqlConn.DataSource, remoteComputerName);
}
site.Add(new Database(providerName, name, sqlConn.ConnectionString) { ParentSite = site });
}
catch (System.ArgumentException e)
{
MessageBox.Show(e.ToString());
TraceHelper.Tracer.WriteTrace(e.ToString());
}
}
}
}
}
catch (Exception ex)
{
site.Errors.Add(ex.Message);
TraceHelper.Tracer.WriteTrace(ex.ToString());
}
}
示例9: SetDataHelperNamesLegacyConnectionString
private static void SetDataHelperNamesLegacyConnectionString(DbConnectionStringBuilder connectionStringBuilder)
{
// get the data layer type and parse it
var datalayerType = String.Empty;
if (connectionStringBuilder.ContainsKey(ConnectionStringDataLayerIdentifier))
{
datalayerType = connectionStringBuilder[ConnectionStringDataLayerIdentifier].ToString();
connectionStringBuilder.Remove(ConnectionStringDataLayerIdentifier);
}
_connectionString = connectionStringBuilder.ConnectionString;
var datalayerTypeParts = datalayerType.Split(",".ToCharArray());
_dataHelperTypeName = datalayerTypeParts[0].Trim();
_dataHelperAssemblyName = datalayerTypeParts.Length < 2
? string.Empty
: datalayerTypeParts[1].Trim();
if (datalayerTypeParts.Length > 2 || (_dataHelperTypeName.Length == 0 && _dataHelperAssemblyName.Length > 0))
throw new ArgumentException("Illegal format of data layer property. Should be 'DataLayer = Full_Type_Name [, Assembly_Name]'.", "connectionString");
}
示例10: ConvertConnectionStringToNewPath
private string ConvertConnectionStringToNewPath(
string providerInvariantName, string filePathKey, string oldConnectionString, string newFilePath, bool useDataDirectoryMacro)
{
if (string.IsNullOrEmpty(filePathKey))
{
Debug.Fail("requires non-null, non-empty filePathKey");
return oldConnectionString;
}
if (LocalDataUtil.IsSqlMobileConnectionString(providerInvariantName))
{
// DbConnectionString does not support SQL Mobile
return GenerateNewSqlMobileConnectionString(oldConnectionString, newFilePath, useDataDirectoryMacro);
}
var dbConnectionStringBuilder = new DbConnectionStringBuilder();
dbConnectionStringBuilder.ConnectionString = oldConnectionString;
object filePathObject;
dbConnectionStringBuilder.TryGetValue(filePathKey, out filePathObject);
var filePath = filePathObject as string;
if (string.IsNullOrEmpty(filePath))
{
Debug.Fail("could not find filePath for filePathKey=" + filePathKey);
return oldConnectionString;
}
// replace old path with new one
dbConnectionStringBuilder.Remove(filePathKey);
if (useDataDirectoryMacro)
{
dbConnectionStringBuilder.Add(filePathKey, DataDirectoryMacro + Path.DirectorySeparatorChar + Path.GetFileName(newFilePath));
}
else
{
dbConnectionStringBuilder.Add(filePathKey, newFilePath);
}
return dbConnectionStringBuilder.ConnectionString;
}
示例11: DbConnectionStringBuilder
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] // File.Exists method call.
void IProvider.CreateDatabase()
{
this.CheckDispose();
this.CheckInitialized();
// Don't need to call CheckNotDeleted() here since we allow CreateDatabase after DeleteDatabase
// Don't need to call InitializeProviderMode() here since we don't need to know the provider to do this.
string catalog = null;
string filename = null;
DbConnectionStringBuilder builder = new DbConnectionStringBuilder();
builder.ConnectionString = _conManager.Connection.ConnectionString;
if(_conManager.Connection.State == ConnectionState.Closed)
{
if(_mode == SqlServerProviderMode.SqlCE)
{
if(!File.Exists(_dbName))
{
Type engineType = _conManager.Connection.GetType().Module.GetType("System.Data.SqlServerCe.SqlCeEngine");
object engine = Activator.CreateInstance(engineType, new object[] { builder.ToString() });
try
{
engineType.InvokeMember("CreateDatabase", BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, engine, new object[] { }, CultureInfo.InvariantCulture);
}
catch(TargetInvocationException tie)
{
throw tie.InnerException;
}
finally
{
IDisposable disp = engine as IDisposable;
if(disp != null)
{
disp.Dispose();
}
}
}
else
{
throw Error.CreateDatabaseFailedBecauseSqlCEDatabaseAlreadyExists(_dbName);
}
}
else
{
// get connection string w/o reference to new catalog
object val;
if(builder.TryGetValue("Initial Catalog", out val))
{
catalog = val.ToString();
builder.Remove("Initial Catalog");
}
if(builder.TryGetValue("Database", out val))
{
catalog = val.ToString();
builder.Remove("Database");
}
if(builder.TryGetValue("AttachDBFileName", out val))
{
filename = val.ToString();
builder.Remove("AttachDBFileName");
}
}
_conManager.Connection.ConnectionString = builder.ToString();
}
else
{
if(_mode == SqlServerProviderMode.SqlCE)
{
if(File.Exists(_dbName))
{
throw Error.CreateDatabaseFailedBecauseSqlCEDatabaseAlreadyExists(_dbName);
}
}
object val;
if(builder.TryGetValue("Initial Catalog", out val))
{
catalog = val.ToString();
}
if(builder.TryGetValue("Database", out val))
{
catalog = val.ToString();
}
if(builder.TryGetValue("AttachDBFileName", out val))
{
filename = val.ToString();
}
}
if(String.IsNullOrEmpty(catalog))
{
if(!String.IsNullOrEmpty(filename))
{
catalog = Path.GetFullPath(filename);
}
else if(!String.IsNullOrEmpty(_dbName))
{
catalog = _dbName;
}
else
//.........这里部分代码省略.........
示例12: Patch
public string Patch(string connectionString) {
var builder = new DbConnectionStringBuilder { ConnectionString = connectionString };
string instanceName = GetSqlServerInstanceName();
builder["Data Source"] = instanceName;
if(!instanceName.ToUpper().Contains(".\\SQLEXPRESS")) {
builder.Remove("User Instance");
}
return builder.ConnectionString;
}
示例13: CreateSqlHelper
/// <summary>
/// Creates a SQL helper for the specified connection string.
/// </summary>
/// <param name="connectionString">The connection string containing the SQL helper type.</param>
/// <returns>A new SQL helper.</returns>
/// <remarks>This method will change to allow the addition of external SQL helpers.</remarks>
public static ISqlHelper CreateSqlHelper(string connectionString)
{
/* check arguments */
if (String.IsNullOrEmpty(connectionString))
throw new ArgumentNullException("connectionString");
/* try to parse connection string */
DbConnectionStringBuilder connectionStringBuilder = new DbConnectionStringBuilder();
try
{
connectionStringBuilder.ConnectionString = connectionString;
}
catch (Exception ex)
{
throw new ArgumentException("Bad connection string.", "connectionString", ex);
}
// get the data layer type and parse it
string datalayerType = String.Empty;
if (connectionStringBuilder.ContainsKey(ConnectionStringDataLayerIdentifier))
{
datalayerType = connectionStringBuilder[ConnectionStringDataLayerIdentifier].ToString();
connectionStringBuilder.Remove(ConnectionStringDataLayerIdentifier);
}
string[] datalayerTypeParts = datalayerType.Split(",".ToCharArray());
string helperTypeName = datalayerTypeParts[0].Trim();
string helperAssemblyName = datalayerTypeParts.Length < 2 ? String.Empty
: datalayerTypeParts[1].Trim();
if (datalayerTypeParts.Length > 2 || (helperTypeName.Length == 0 && helperAssemblyName.Length > 0))
throw new ArgumentException("Illegal format of data layer property. Should be 'DataLayer = Full_Type_Name [, Assembly_Name]'.", "connectionString");
/* create the helper */
// find the right assembly
Assembly helperAssembly = Assembly.GetExecutingAssembly();
if (datalayerTypeParts.Length == 2)
{
try
{
helperAssembly = Assembly.Load(helperAssemblyName);
}
catch (Exception exception)
{
throw new UmbracoException(String.Format("Could not load assembly {0}.", helperAssemblyName), exception);
}
}
// find the right type
Type helperType;
if (helperTypeName == String.Empty)
helperTypeName = DefaultDataHelperName;
if (!helperTypeName.Contains("."))
helperTypeName = String.Format(DefaultDataHelperFormat, helperTypeName);
try
{
helperType = helperAssembly.GetType(helperTypeName, true, true);
}
catch (Exception exception)
{
throw new UmbracoException(String.Format("Could not load type {0} ({1}).", helperTypeName, helperAssembly.FullName), exception);
}
// find the right constructor
ConstructorInfo constructor = helperType.GetConstructor(new Type[] { typeof(string) });
if (constructor == null)
throw new UmbracoException(String.Format("Could not find constructor that takes a connection string as parameter. ({0}, {1}).", helperTypeName, helperAssembly.FullName));
// finally, return the helper
try
{
return constructor.Invoke(new object[] { connectionStringBuilder.ConnectionString }) as ISqlHelper;
}
catch (Exception exception)
{
throw new UmbracoException(String.Format("Could not execute constructor of type {0} ({1}).", helperTypeName, helperAssembly.FullName), exception);
}
}
示例14: _StripDbName
/// <summary>
/// Strips out the database instance name from a connectionString.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="dbName">Name of the db.</param>
/// <returns>The newly created connection string.</returns>
private static string _StripDbName(string connectionString, string providerName, out string dbName, out string dbFile)
{
var builder = new DbConnectionStringBuilder
{
ConnectionString = connectionString
};
string dbname = null, dbfile = null;
object tmp;
// SQLServer.. minimal option..
if (builder.TryGetValue("Initial Catalog", out tmp))
{
dbname = tmp.ToString();
builder.Remove("Initial Catalog");
}
// SQLServer default option..
if (builder.TryGetValue("Database", out tmp))
{
dbname = tmp.ToString();
builder.Remove("Database");
}
// SQLite! (XXX: MsSql has 'Data Source' as a means to specify Server address)
if ((providerName == SQLiteProvider || providerName == SqlCe) && builder.TryGetValue("Data Source", out tmp))
{
dbname = tmp.ToString();
builder.Remove("Data Source");
}
// SQLServer (auto attach alternate)
if (builder.TryGetValue("AttachDBFileName", out tmp))
{
dbfile = tmp.ToString();
// Replace |DataDirectory| in connection string.
dbfile = dbfile.Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory") as string);
builder.Remove("AttachDBFileName");
}
// Oracle SID
if (providerName == OracleDataProvider && builder.TryGetValue("Data Source", out tmp))
{
string connStr = tmp.ToString().Replace(" ", "").Replace("\r", "").Replace("\n", "");
Match match = Regex.Match(connStr, @"SERVICE_NAME=([^\)]+)");
if (match.Success)
{
dbname = match.Groups[1].Value;
}
// Try EZ-Connect method..
if (string.IsNullOrEmpty(dbname))
{
match = Regex.Match(connStr, ".*/([^$]*)$");
if (match.Success)
{
dbname = match.Groups[1].Value;
}
}
}
// If no database is specified at connStr, throw error..
if (string.IsNullOrEmpty(dbname) && string.IsNullOrEmpty(dbfile))
{
throw new ArgumentException("ConnectionString should specify a database name or file");
}
// If not catalog nor database name passed, try to obtain it from db file path.
if (string.IsNullOrEmpty(dbname))
{
dbname = dbfile;
}
// Save return values..
dbName = dbname;
dbFile = dbfile;
return builder.ToString();
}
示例15: Remove
public void Remove ()
{
Assert.IsFalse (builder.Remove ("Dsn"), "#A1");
Assert.IsFalse (builder.Remove ("Driver"), "#A2");
builder.Add ("DriverID", "790");
builder ["DefaultDir"] = "C:\\";
Assert.IsTrue (builder.Remove ("DriverID"), "#B1");
Assert.IsFalse (builder.ContainsKey ("DriverID"), "#B2");
Assert.IsFalse (builder.Remove ("DriverID"), "#B3");
Assert.IsFalse (builder.ContainsKey ("DriverID"), "#B4");
Assert.IsTrue (builder.Remove ("defaulTdIr"), "#B5");
Assert.IsFalse (builder.ContainsKey ("DefaultDir"), "#B6");
Assert.IsFalse (builder.Remove ("defaulTdIr"), "#B7");
Assert.IsFalse (builder.Remove ("userid"), "#B8");
Assert.IsFalse (builder.Remove (string.Empty), "#B9");
Assert.IsFalse (builder.Remove ("\r"), "#B10");
Assert.IsFalse (builder.Remove ("a;"), "#B11");
builder ["Dsn"] = "myDsn";
Assert.IsTrue (builder.Remove ("Dsn"), "#C1");
Assert.IsFalse (builder.ContainsKey ("Dsn"), "#C2");
Assert.IsFalse (builder.Remove ("Dsn"), "#C3");
builder ["Driver"] = "SQL Server";
Assert.IsTrue (builder.Remove ("Driver"), "#D1");
Assert.IsFalse (builder.ContainsKey ("Driver"), "#D2");
Assert.IsFalse (builder.Remove ("Driver"), "#D3");
builder = new DbConnectionStringBuilder (false);
Assert.IsFalse (builder.Remove ("Dsn"), "#A1");
Assert.IsFalse (builder.Remove ("Driver"), "#A2");
builder.Add ("DriverID", "790");
builder ["DefaultDir"] = "C:\\";
Assert.IsTrue (builder.Remove ("DriverID"), "#B1");
Assert.IsFalse (builder.ContainsKey ("DriverID"), "#B2");
Assert.IsFalse (builder.Remove ("DriverID"), "#B3");
Assert.IsFalse (builder.ContainsKey ("DriverID"), "#B4");
Assert.IsTrue (builder.Remove ("defaulTdIr"), "#B5");
Assert.IsFalse (builder.ContainsKey ("DefaultDir"), "#B6");
Assert.IsFalse (builder.Remove ("defaulTdIr"), "#B7");
Assert.IsFalse (builder.Remove ("userid"), "#B8");
Assert.IsFalse (builder.Remove (string.Empty), "#B9");
Assert.IsFalse (builder.Remove ("\r"), "#B10");
Assert.IsFalse (builder.Remove ("a;"), "#B11");
builder ["Dsn"] = "myDsn";
Assert.IsTrue (builder.Remove ("Dsn"), "#C1");
Assert.IsFalse (builder.ContainsKey ("Dsn"), "#C2");
Assert.IsFalse (builder.Remove ("Dsn"), "#C3");
builder ["Driver"] = "SQL Server";
Assert.IsTrue (builder.Remove ("Driver"), "#D1");
Assert.IsFalse (builder.ContainsKey ("Driver"), "#D2");
Assert.IsFalse (builder.Remove ("Driver"), "#D3");
builder = new DbConnectionStringBuilder (true);
Assert.IsFalse (builder.Remove ("Dsn"), "#A1");
Assert.IsFalse (builder.Remove ("Driver"), "#A2");
builder.Add ("DriverID", "790");
builder ["DefaultDir"] = "C:\\";
Assert.IsTrue (builder.Remove ("DriverID"), "#B1");
Assert.IsFalse (builder.ContainsKey ("DriverID"), "#B2");
Assert.IsFalse (builder.Remove ("DriverID"), "#B3");
Assert.IsFalse (builder.ContainsKey ("DriverID"), "#B4");
Assert.IsTrue (builder.Remove ("defaulTdIr"), "#B5");
Assert.IsFalse (builder.ContainsKey ("DefaultDir"), "#B6");
Assert.IsFalse (builder.Remove ("defaulTdIr"), "#B7");
Assert.IsFalse (builder.Remove ("userid"), "#B8");
Assert.IsFalse (builder.Remove (string.Empty), "#B9");
Assert.IsFalse (builder.Remove ("\r"), "#B10");
Assert.IsFalse (builder.Remove ("a;"), "#B11");
builder ["Dsn"] = "myDsn";
Assert.IsTrue (builder.Remove ("Dsn"), "#C1");
Assert.IsFalse (builder.ContainsKey ("Dsn"), "#C2");
Assert.IsFalse (builder.Remove ("Dsn"), "#C3");
builder ["Driver"] = "SQL Server";
Assert.IsTrue (builder.Remove ("Driver"), "#D1");
Assert.IsFalse (builder.ContainsKey ("Driver"), "#D2");
Assert.IsFalse (builder.Remove ("Driver"), "#D3");
}