0
|
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 }
|