| | |
Problems with transaction in SQL Server Mobile
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2009
Posts: 2
Reputation:
Solved Threads: 0
Hello
I try pass data from a table in Firebird to SQL server Mobile. I'm using c# in vs2005, and I have problems with transactions. At the end, if I want to rollback transaction, I would like to undo changes, but in the code I show you, Changes allways saves in database.
Why doesn't rollback works ?
I try pass data from a table in Firebird to SQL server Mobile. I'm using c# in vs2005, and I have problems with transactions. At the end, if I want to rollback transaction, I would like to undo changes, but in the code I show you, Changes allways saves in database.
Why doesn't rollback works ?
public class MoveData
{
private SqlCeConnection conection;
private SqlCeTransaction trans;
private SqlCeDataAdapter command;
public MoveData(String path)
{
conection = new SqlCeConnection(@"Data Source=D:\MyDataBase.sdf");
conection.Open();
}
public void MovingData()
{
//It's a empty table
command = new SqlCeDataAdapter("SELECT * FROM INVOICE", conection);
DataSet dataSet = new DataSet();
DataSet dataSet = new DataSet();
command.Fill(dataSet, "INVOICE");
DataTable TINVOICE = dataSet.Tables["INVOICE"];
trans = conection.BeginTransaction();
foreach (DataRow row in TINVOICEotherdatabasetable.Rows)
{
DataRow row1 = TINVOICE.NewRow();
foreach(DataColumn column in TINVOICEotherdatabasetable.Columns)
{
row1[column.ColumnName] = row[column.ColumnName];
}
TINVOICE.Rows.Add(row1);
}
SqlCeCommandBuilder commands = new SqlCeCommandBuilder(command);
command.Update(dataSet,"INVOICE"); //here save me changes in database
trans.Rollback();// this Rollback doesn't work, Why ??
}
} Have a look http://msdn.microsoft.com/en-us/libr...ck(VS.80).aspx
It may should be defined in IsolationLevel member... I don't know I need to help, wish for you th best..
It may should be defined in IsolationLevel member... I don't know I need to help, wish for you th best..
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Other Threads in the C# Forum
- Previous Thread: How to merge two text files
- Next Thread: help with compiler command
| Thread Tools | Search this Thread |
.net access algorithm animation array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml






