本文整理汇总了C#中System.Data.SqlClient.SqlConnectionStringBuilder.TrimNetworkProtocol方法的典型用法代码示例。如果您正苦于以下问题:C# SqlConnectionStringBuilder.TrimNetworkProtocol方法的具体用法?C# SqlConnectionStringBuilder.TrimNetworkProtocol怎么用?C# SqlConnectionStringBuilder.TrimNetworkProtocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlConnectionStringBuilder
的用法示例。
在下文中一共展示了SqlConnectionStringBuilder.TrimNetworkProtocol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrimNetworkProtocolWithoutNetworkProtocol
public void TrimNetworkProtocolWithoutNetworkProtocol()
{
// Arrange
var cstr = new SqlConnectionStringBuilder("Data Source=blahblah.database.windows.net;Initial Catalog=NuGetDB");
// Act
cstr.TrimNetworkProtocol();
// Assert
Assert.True(cstr.DataSource.Equals("blahblah.database.windows.net"));
Assert.True(cstr.InitialCatalog.Equals("NuGetDB"));
}
示例2: MDTrigger
public void MDTrigger(MDTriggerArgs args)
{
if (String.IsNullOrEmpty(args.ContainerName))
{
args.ContainerName = "mdtriggers";
}
CloudStorageAccount account = CloudStorageAccount.Parse(args.StorageConnectionString);
CloudBlobClient client = account.CreateCloudBlobClient();
CloudBlobContainer container = client.GetContainerReference(args.ContainerName);
if (container.CreateIfNotExists())
{
Console.WriteLine("Created '{0}' blob container", args.ContainerName);
}
SqlConnectionStringBuilder sql = new SqlConnectionStringBuilder(args.DBConnectionString);
Console.WriteLine("Trimming network protocol if any");
sql.TrimNetworkProtocol();
MetadataTrigger.Start(account, container, sql, args.DumpToCloud).Wait();
}