public void Transaction()
        {
            Guid TempGuid = Guid.NewGuid();

            using (Utilities.SQL.SQLHelper Helper = new Utilities.SQL.SQLHelper("insert into TestTable(StringValue1,StringValue2,BigIntValue,BitValue,DecimalValue,FloatValue,DateTimeValue,GUIDValue) VALUES (@StringValue1,@StringValue2,@BigIntValue,@BitValue,@DecimalValue,@FloatValue,@DateTimeValue,@GUIDValue)", "Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", CommandType.Text))
            {
                Helper.BeginTransaction();
                Helper.AddParameter <string>("@StringValue1", "Test");
                Helper.AddParameter <string>("@StringValue2", "Test");
                Helper.AddParameter <long>("@BigIntValue", 123);
                Helper.AddParameter <bool>("@BitValue", false);
                Helper.AddParameter <decimal>("@DecimalValue", 1234);
                Helper.AddParameter <float>("@FloatValue", 12345);
                Helper.AddParameter <Guid>("@GUIDValue", Guid.NewGuid());
                Helper.AddParameter <DateTime>("@DateTimeValue", new DateTime(1999, 1, 1));
                Helper.ExecuteNonQuery();
                Helper.Rollback();
                Helper.BeginTransaction();
                Helper.AddParameter <string>("@StringValue1", "Test String");
                Helper.AddParameter <string>("@StringValue2", "Test String");
                Helper.AddParameter <long>("@BigIntValue", 12345);
                Helper.AddParameter <bool>("@BitValue", true);
                Helper.AddParameter <decimal>("@DecimalValue", 1234.5678m);
                Helper.AddParameter <float>("@FloatValue", 12345.6534f);
                Helper.AddParameter <Guid>("@GUIDValue", TempGuid);
                Helper.AddParameter <DateTime>("@DateTimeValue", new DateTime(1999, 12, 31));
                Helper.ExecuteNonQuery();
                Helper.Commit();
            }
            using (Utilities.SQL.SQLHelper Helper = new Utilities.SQL.SQLHelper("SELECT * FROM TestTable", "Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", CommandType.Text))
            {
                Helper.ExecuteReader();
                if (Helper.Read())
                {
                    Assert.Equal("Test String", Helper.GetParameter <string>("StringValue1", ""));
                    Assert.Equal("Test String", Helper.GetParameter <string>("StringValue2", ""));
                    Assert.Equal(12345, Helper.GetParameter <long>("BigIntValue", 0));
                    Assert.Equal(true, Helper.GetParameter <bool>("BitValue", false));
                    Assert.Equal(1234.5678m, Helper.GetParameter <decimal>("DecimalValue", 0));
                    Assert.Equal(12345.6534f, Helper.GetParameter <float>("FloatValue", 0));
                    Assert.Equal(TempGuid, Helper.GetParameter <Guid>("GUIDValue", Guid.Empty));
                    Assert.Equal(new DateTime(1999, 12, 31), Helper.GetParameter <DateTime>("DateTimeValue", DateTime.Now));
                }
                else
                {
                    Assert.Fail("Nothing was inserted");
                }
            }
            using (Utilities.SQL.SQLHelper Helper = new Utilities.SQL.SQLHelper("SELECT COUNT(*) as [ItemCount] FROM TestTable", "Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", CommandType.Text))
            {
                Helper.ExecuteReader();
                if (Helper.Read())
                {
                    Assert.Equal(1, Helper.GetParameter <int>("ItemCount", 0));
                }
                else
                {
                    Assert.Fail("Nothing was inserted");
                }
            }
        }
 public void Transaction()
 {
     Guid TempGuid = Guid.NewGuid();
     using (Utilities.SQL.SQLHelper Helper = new Utilities.SQL.SQLHelper("insert into TestTable(StringValue1,StringValue2,BigIntValue,BitValue,DecimalValue,FloatValue,DateTimeValue,GUIDValue) VALUES (@StringValue1,@StringValue2,@BigIntValue,@BitValue,@DecimalValue,@FloatValue,@DateTimeValue,@GUIDValue)", "Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", CommandType.Text))
     {
         Helper.BeginTransaction();
         Helper.AddParameter<string>("@StringValue1", "Test");
         Helper.AddParameter<string>("@StringValue2", "Test");
         Helper.AddParameter<long>("@BigIntValue", 123);
         Helper.AddParameter<bool>("@BitValue", false);
         Helper.AddParameter<decimal>("@DecimalValue", 1234);
         Helper.AddParameter<float>("@FloatValue", 12345);
         Helper.AddParameter<Guid>("@GUIDValue", Guid.NewGuid());
         Helper.AddParameter<DateTime>("@DateTimeValue", new DateTime(1999, 1, 1));
         Helper.ExecuteNonQuery();
         Helper.Rollback();
         Helper.BeginTransaction();
         Helper.AddParameter<string>("@StringValue1", "Test String");
         Helper.AddParameter<string>("@StringValue2", "Test String");
         Helper.AddParameter<long>("@BigIntValue", 12345);
         Helper.AddParameter<bool>("@BitValue", true);
         Helper.AddParameter<decimal>("@DecimalValue", 1234.5678m);
         Helper.AddParameter<float>("@FloatValue", 12345.6534f);
         Helper.AddParameter<Guid>("@GUIDValue", TempGuid);
         Helper.AddParameter<DateTime>("@DateTimeValue", new DateTime(1999, 12, 31));
         Helper.ExecuteNonQuery();
         Helper.Commit();
     }
     using (Utilities.SQL.SQLHelper Helper = new Utilities.SQL.SQLHelper("SELECT * FROM TestTable", "Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", CommandType.Text))
     {
         Helper.ExecuteReader();
         if (Helper.Read())
         {
             Assert.Equal("Test String", Helper.GetParameter<string>("StringValue1", ""));
             Assert.Equal("Test String", Helper.GetParameter<string>("StringValue2", ""));
             Assert.Equal(12345, Helper.GetParameter<long>("BigIntValue", 0));
             Assert.Equal(true, Helper.GetParameter<bool>("BitValue", false));
             Assert.Equal(1234.5678m, Helper.GetParameter<decimal>("DecimalValue", 0));
             Assert.Equal(12345.6534f, Helper.GetParameter<float>("FloatValue", 0));
             Assert.Equal(TempGuid, Helper.GetParameter<Guid>("GUIDValue", Guid.Empty));
             Assert.Equal(new DateTime(1999, 12, 31), Helper.GetParameter<DateTime>("DateTimeValue", DateTime.Now));
         }
         else
         {
             Assert.Fail("Nothing was inserted");
         }
     }
     using (Utilities.SQL.SQLHelper Helper = new Utilities.SQL.SQLHelper("SELECT COUNT(*) as [ItemCount] FROM TestTable", "Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", CommandType.Text))
     {
         Helper.ExecuteReader();
         if (Helper.Read())
         {
             Assert.Equal(1,Helper.GetParameter<int>("ItemCount",0));
         }
         else
         {
             Assert.Fail("Nothing was inserted");
         }
     }
 }