ExecuteDataSet

BLToolkit.NET

Business Logic Toolkit for .NET www.bltoolkit.net
  ExecuteDataSet.cs
using System;
using System.Data;

using NUnit.Framework;

using BLToolkit.Data;

namespace HowTo.Data
{
    [TestFixture]
    public class ExecuteDataSet
    {
        [Test]
        public void Test()
        {
            using (DbManager db = new DbManager())
            {
                DataSet ds = db
                    .SetCommand("SELECT * FROM Person")
                    .ExecuteDataSet();

                Assert.AreNotEqual(0, ds.Tables[0].Rows.Count);
            }
        }
    }
}
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add
            key   = "ConnectionString"
            value = "Server=.;Database=BLToolkitData;Integrated Security=SSPI"/>
    </appSettings>
</configuration>
Create.sql script
 
© 2010 www.bltoolkit.net
[email protected]