Mercurial > pub > bltoolkit
comparison HowTo/Data/DataProvider/AddDataProvider.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f990fcb411a9 |
---|---|
1 using System; | |
2 | |
3 using NUnit.Framework; | |
4 | |
5 using BLToolkit.Data; | |
6 using BLToolkit.Data.DataProvider; | |
7 | |
8 namespace HowTo.Data.DataProvider | |
9 { | |
10 [TestFixture] | |
11 public class AddDataProvider | |
12 { | |
13 const string connectionString = | |
14 "Provider=ASEOLEDB;Data Source=server;Catalog=database;User Id=user;Password=pwd;"; | |
15 | |
16 [Test] | |
17 public void Test() | |
18 { | |
19 // 3rd party data provider registration. | |
20 // | |
21 DbManager./*[a]*/AddDataProvider/*[/a]*/(new /*[a]*/SybaseAdoDataProvider/*[/a]*/()); | |
22 | |
23 // It can be configured by App.config. | |
24 // We use this way for the demo purpose only. | |
25 // | |
26 DbManager.AddConnectionString( | |
27 "SybaseAdo", // Provider name | |
28 "Default", // Configuration | |
29 connectionString); // Connection string | |
30 | |
31 using (DbManager db = new DbManager("SybaseAdo", "Default")) | |
32 { | |
33 } | |
34 } | |
35 } | |
36 } |