---------- Forwarded message ----------
From: Matthew Brand <[EMAIL PROTECTED]>
Date: Dec 1, 2005 9:45 AM
Subject: Help on rollback attribute
To: [EMAIL PROTECTED]

I've searched everywhere for some examples on how to get this jazz working and I can't find anything so I would really appreciate your help on the matter.  I need help with the rollbackattribute in particular.  Is there something that needs to be done to add stuff to the transaction to get the rollback attribute to function properly? Here's what I've been trying.  It updates fine but it doesn't roll it back.  I'm running Windows Server 2003 and VS.NET 2005.

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MbUnit.Core.Framework;
using MbUnit.Framework ;

namespace WebsiteTest
{
    [TestFixture]
    class DBTest
    {
        [Test, RollBack]
        public void GetPage()
        {
            string connectionString = "Server=localhost;Database=databaseName;User ID=userID;Password=password";

            System.Data.SqlClient.SqlConnection DbConnection = new System.Data.SqlClient.SqlConnection(connectionString);

            string sqlCommand = "UPDATE pageinfo SET displayname='Less Sucky Page6';";

            IDbCommand dataCommand = DbConnection.CreateCommand();
            dataCommand.CommandText = sqlCommand;
            DbConnection.Open ();
            dataCommand.ExecuteNonQuery();
            DbConnection.Close();

            Assert.IsTrue(1 == 1);
        }
    }

 

Thank you in advance,

Matthew Brand

 



--
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply via email to