Showing posts with label operations. Show all posts
Showing posts with label operations. Show all posts

Tuesday, March 27, 2012

Does SQL Server CE support System.Transactions?

Hi,

I've tried to enclose a few database operations in a TransactionScope block but it looks like SQL Server CE RM does ignores ambiental transaction.

Here is the code:

static void TestTxn() {
// Command to insert an integer in a table with a single integer column
string cmdPassText = "INSERT TESTTABLE (INTFIELD) VALUES(1)";
// Command to force field type mismatch exception
string cmdFailText = "INSERT TESTTABLE (INTFIELD) VALUES('Foo')";

using (TransactionScope scope = new TransactionScope()) {
using (SqlCeConnection conn = new SqlCeConnection("DataSource = 'Test.sdf'")) {
try {
conn.Open();
SqlCeCommand cmdPass = new SqlCeCommand(cmdPassText, conn);
returnValue = cmdPass.ExecuteNonQuery();
SqlCeCommand cmdFail = new SqlCeCommand(cmdFailText, conn);
returnValue = cmdFail.ExecuteNonQuery();
}
catch (Exception ex){
Console.WriteLine("Command failed");
Console.WriteLine("Exception Message: {0}", ex.Message);
}
}
scope.Complete();
}
}

After first command suceeds and seccond command failes table still has one affected row after transaction.

Am I doing something wrong or System.Transactions.Transaction is not supported with SQL Server CE RM?

Thanks,
Aleksandar

System.Transactions.Transaction is not supported in SQL Server CE RTM. It will be added in the next release of Visual Studio though.

Thanks

Pragya

Sunday, February 26, 2012

does anybody use MOM ?

HI,
Does anybody use Microsoft Operations Manager (MOM) ?
Thank you
DannyForget my question :-)
I found forum of MOM (Microsoft.public.mom.sql)
Danny
Danny Presse a =E9crit :
> HI,
> Does anybody use Microsoft Operations Manager (MOM) ?
> Thank you
> Danny