Business Logic Toolkit for .NET
www.bltoolkit.net
Welcome Guest, you are in: Login
|  Home   |  Download   |  Documentation   |  Discussions   |  Issues   |  License   |
RSS RSS

Navigation




Search the wiki
»

PoweredBy
Close.cs

using System;
using NUnit.Framework;
using BLToolkit.Data;

namespace HowTo.Data { [TestFixture] public class Close { [Test] public void Test1() { var db = new DbManager();

try { // ... } finally { if (db != null) db.Close(); } }

// Consider using the C# using statement instead. // [Test] public void Test2() { using (var db = new DbManager()) { // ... } } } }

App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <connectionStrings>
        <add
            name             = "DemoConnection"
            connectionString = "Server=.;Database=BLToolkitData;Integrated Security=SSPI"
            providerName     = "System.Data.SqlClient" />
    </connectionStrings>
</configuration>
© 2010 www.bltoolkit.net