• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IConnectionString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IConnectionString的典型用法代码示例。如果您正苦于以下问题:C# IConnectionString类的具体用法?C# IConnectionString怎么用?C# IConnectionString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IConnectionString类属于命名空间,在下文中一共展示了IConnectionString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SisoConnectionInfo

        public SisoConnectionInfo(IConnectionString connectionString)
        {
            if(connectionString == null)
                throw new ArgumentNullException("connectionString");

            Initialize(connectionString);
        }
开发者ID:darrencauthon,项目名称:SisoDb-Provider,代码行数:7,代码来源:SisoConnectionInfo.cs


示例2: ConvertToConnectionString

        private static string ConvertToConnectionString(IConnectionString connectionString)
        {
            var cnStringBuilder = new SqlCeConnectionStringBuilder(connectionString.PlainString);
            cnStringBuilder.Enlist = false;

            return connectionString.ReplacePlain(cnStringBuilder.ConnectionString).PlainString;
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:7,代码来源:SqlCe4TestDbUtils.cs


示例3: OpenServerConnection

		public IDbConnection OpenServerConnection(IConnectionString connectionString)
		{
			var cn = new SqlCeConnection(connectionString.PlainString);
			cn.Open();

			return cn;
		}
开发者ID:BlackMael,项目名称:SisoDb-Provider,代码行数:7,代码来源:SqlCe4ConnectionManager.cs


示例4: OnFormatConnectionString

        protected override IConnectionString OnFormatConnectionString(IConnectionString connectionString)
        {
            var cnString = base.OnFormatConnectionString(connectionString);
            var cnStringBuilder = new SqlCeConnectionStringBuilder(cnString.PlainString) { Enlist = false };

            return connectionString.ReplacePlain(cnStringBuilder.ConnectionString);
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:7,代码来源:SqlCe4ConnectionInfo.cs


示例5: OnFormatServerConnectionString

        protected override IConnectionString OnFormatServerConnectionString(IConnectionString connectionString)
        {
            var cnString = base.OnFormatServerConnectionString(connectionString);
            var cnStringBuilder = new SqlConnectionStringBuilder(cnString.PlainString) { InitialCatalog = string.Empty };

            return cnString.ReplacePlain(cnStringBuilder.ConnectionString);
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:7,代码来源:SqlServerConnectionInfo.cs


示例6: DatabaseFactory

        public DatabaseFactory(IConnectionString connectionString, ILogWriter logWriter)
        {
            Checks.Argument.IsNotNull(connectionString, "connectionString");

            _connectionString = connectionString.Value;
            _logWriter = logWriter;
        }
开发者ID:coredweller,项目名称:MP3-Tag-Altering,代码行数:7,代码来源:DatabaseFactory.cs


示例7: NHibernateSessionSource

 public NHibernateSessionSource(IEnumerable<IMappingConfiguration> mappingConfigurations,
                                IConnectionString connectionString)
 {
     _mappingConfigurations = mappingConfigurations;
     _connectionString = connectionString;
     _configuration = AssembleConfiguration(null);
     _sessionFactory = _configuration.BuildSessionFactory();
 }
开发者ID:brocksamson,项目名称:Evil,代码行数:8,代码来源:NHibernateSessionSource.cs


示例8: Sql2008ConnectionInfo

        public Sql2008ConnectionInfo(IConnectionString connectionString) 
            : base(connectionString)
        {
            if (ProviderType != StorageProviders.Sql2008)
                throw new SisoDbException(ExceptionMessages.ConnectionInfo_UnsupportedProviderSpecified.Inject(ProviderType, StorageProviders.Sql2008));

            InitializeDbNameAndServerConnectionString();
        }
开发者ID:BlackMael,项目名称:SisoDb-Provider,代码行数:8,代码来源:Sql2008ConnectionInfo.cs


示例9: Add

        /// <summary>
        /// Adds the specified synced module index entry, together with the online connection string.
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        /// <param name="entry">The entry.</param>
        /// <remarks>Documented by Dev02, 2009-03-26</remarks>
        public static void Add(IConnectionString connectionString, LearningModulesIndexEntry entry)
        {
            if (!syncedModules.ContainsKey(connectionString.ConnectionString))
                syncedModules[connectionString.ConnectionString] = new List<LearningModulesIndexEntry>();

            syncedModules[connectionString.ConnectionString].RemoveAll(e => e.SyncedPath == entry.SyncedPath && e.ConnectionName == entry.ConnectionName && e.UserName == entry.UserName);
            syncedModules[connectionString.ConnectionString].Add(entry);
        }
开发者ID:hmehr,项目名称:OSS,代码行数:14,代码来源:SyncedModulesIndex.cs


示例10: OnExtractDbName

        protected override string OnExtractDbName(IConnectionString connectionString)
        {
            var filePath = ExtractFilePath(ClientConnectionString);

            return filePath.Contains(Path.DirectorySeparatorChar.ToString())
                ? Path.GetFileNameWithoutExtension(filePath)
                : filePath;
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:8,代码来源:SqlCe4ConnectionInfo.cs


示例11: NHibernateConfigurationFactory

 public NHibernateConfigurationFactory(
     INHibernateMappingConfigurationFactory mappingConfigurationFactory,
     IConnectionString connectionString,
     IFoundationConfigurator foundationConfigurator)
 {
     this.mappingConfigurationFactory = mappingConfigurationFactory;
     this.connectionString = connectionString;
     this.foundationConfigurator = foundationConfigurator;
 }
开发者ID:AbdoNile,项目名称:Foundation.Old,代码行数:9,代码来源:NhibernateConfigurationFactory.cs


示例12: BasicConfiguration

		public BasicConfiguration(IConnectionString connectionString) {
			_configuration = new Configuration();
			_configuration.Proxy(p => p.ProxyFactoryFactory<DefaultProxyFactoryFactory>())
						  .DataBaseIntegration(db => {
							  db.ConnectionString = connectionString.FormattedConnectionString;
							  db.Dialect<MsSql2008Dialect>();
						  })
						  .AddAssembly(typeof(NHTestEntity).Assembly);
		}
开发者ID:tarwn,项目名称:StaticVoid.OrmPerformance,代码行数:9,代码来源:BasicConfiguration.cs


示例13: EnsureCorrectProviderIfItExists

        private void EnsureCorrectProviderIfItExists(IConnectionString connectionString)
        {
            var providerType = ExtractProviderType(connectionString);
            if (providerType == null)
                return;

            if (providerType != ProviderType)
                throw new SisoDbException(ExceptionMessages.ConnectionInfo_UnsupportedProviderSpecified.Inject(providerType, ProviderType));
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:9,代码来源:SisoConnectionInfo.cs


示例14: SqlCe4ConnectionInfo

        public SqlCe4ConnectionInfo(IConnectionString connectionString)
            : base(StorageProviders.SqlCe4, connectionString)
        {
            _filePath = ExtractFilePath(ClientConnectionString);
            _serverPath = Path.GetDirectoryName(FilePath);

            if (string.IsNullOrWhiteSpace(DbName))
                throw new SisoDbException(ExceptionMessages.ConnectionInfo_MissingName);
        }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:9,代码来源:SqlCe4ConnectionInfo.cs


示例15: FormatServerConnectionString

 private IConnectionString FormatServerConnectionString(IConnectionString connectionString)
 {
     try
     {
         return OnFormatServerConnectionString(connectionString);
     }
     catch (Exception ex)
     {
         throw new SisoDbException("Could not parse sent server connection string. If connection string name is passed. Ensure it has match in config-file. Inspect inner exception for more details.", new[] { ex });
     }
 }
开发者ID:MikaelEliasson,项目名称:SisoDb-Provider,代码行数:11,代码来源:SisoConnectionInfo.cs


示例16: SessionBuilder

 public SessionBuilder(IConnectionString connectionString)
 {
     this.connectionString = connectionString;
     if(sessionFactory!=null) return;
     lock (factorySyncRoot)
     {
         if(sessionFactory!=null) return;
         configuration = AssemblyConfiguration();
         sessionFactory = configuration.BuildSessionFactory();
     }
 }
开发者ID:diegocaxito,项目名称:TeAjudo,代码行数:11,代码来源:SessionBuilder.cs


示例17: OpenDbConnection

		public IDbConnection OpenDbConnection(IConnectionString connectionString)
		{
			IDbConnection cn;

			var connectionsPerCnString = GetConnectionsForConnectionString(connectionString.PlainString);
			if (connectionsPerCnString.TryTake(out cn))
				return cn;

			cn = new SqlCeConnection(connectionString.PlainString);
			cn.Open();
			return cn;
		}
开发者ID:BlackMael,项目名称:SisoDb-Provider,代码行数:12,代码来源:SqlCe4ConnectionManager.cs


示例18: SetUp

            public void SetUp()
            {
                _connectionString = MockRepository.GenerateMock<IConnectionString>();
                _fileConfiguration = MockRepository.GenerateMock<IFileConfiguration>();
                _dataProvider = new OleDbDataProvider(new ConnectionBuilder(_connectionString), _fileConfiguration);

                _xlsxFile = TestData.UsersXlsx;
                _xlsFile = TestData.UsersXls;
                _workSheetName = "User";

                _connectionString.Expect(x => x.Get(_xlsxFile)).Return(TestData.UsersXlsxConnectionString).Repeat.Any();
                _connectionString.Expect(x => x.Get(_xlsFile)).Return(TestData.UsersXlsConnectionString).Repeat.Any();
            }
开发者ID:mvba,项目名称:ExcelMapper,代码行数:13,代码来源:OleDBDataProviderTests.cs


示例19: ConnectionStringSelectorViewModel

        public ConnectionStringSelectorViewModel(IEventAggregator eventAggregator, IConnectionString connectionString, bool isEnabled)
        {
            this.eventAggregator = eventAggregator;

            this.connectionString = connectionString;
            this.IsEnabled = isEnabled;

            SelectConnectionStringCommand = new DelegateCommand<object>(SelectConnectionString);
            RefreshCommand = new DelegateCommand<object>(Refresh);

            var connectionStringChangedEvent = eventAggregator.GetEvent<ConnectionStringChangedEvent>();
            connectionStringChangedEvent.Subscribe(SetInactive);
        }
开发者ID:svstoichkov,项目名称:Eugenie-v2,代码行数:13,代码来源:ConnectionStringSelectorViewModel.cs


示例20: SetCurrentUser

 public void SetCurrentUser(IConnectionString connectionString)
 {
     if (connectionString is TextualConnectionString)
     {
         var oracleConnectionString = new OracleConnectionString(((TextualConnectionString)connectionString).ConnectionString);
         SetCurrentUserToOracleConnectionString(oracleConnectionString);
         connectionString.ConnectionString = oracleConnectionString.ConnectionString;
     }
     else if (connectionString is OracleConnectionString)
     {
         SetCurrentUserToOracleConnectionString((OracleConnectionString)connectionString);
     }
 }
开发者ID:nttung91,项目名称:PLSoft,代码行数:13,代码来源:OracleUserIdChanger.cs



注:本文中的IConnectionString类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IConnector类代码示例发布时间:2022-05-24
下一篇:
C# IConnectionProvider类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap