F
flemming eriksen
I have made testprograms, consulted articles, but don't get it
right(SQL2000, C#, ADO.NET)
The following simple problem:
Conn.BeginTransaction()
select * from table1 where key = '1'
//
// record is treated - and now should NOBODY be able to update the
Reacord
//
UPDATE table1 SET field1='bla' where key='1'
Transaction.Commit();
But when I go to the debugger after the record is read in, and fire an
QA-Update on the record, it's updated.
conn==new SqlConnection(" connect string here");
SqlCommad cmd=new SqlCommand("select * from table1 where key = @key",conn);
conn.Open();
Trans = conn.BeginTransaction();
cmd.Transaction=Trans;
cmd.Parameters.Add("@key",SqlDbType.Int);
cmd.Parameters["key"].Value = 1; // the parameter
myReader=cmd.ExecuteReader();
myReader.Read()
// here I set the breakpoint and fire the UpdateCommand in QA, which to my
disunderstanding updated the record in table1.
/
What am I doing wrong?
Regards,
Flemming
right(SQL2000, C#, ADO.NET)
The following simple problem:
Conn.BeginTransaction()
select * from table1 where key = '1'
//
// record is treated - and now should NOBODY be able to update the
Reacord
//
UPDATE table1 SET field1='bla' where key='1'
Transaction.Commit();
But when I go to the debugger after the record is read in, and fire an
QA-Update on the record, it's updated.
conn==new SqlConnection(" connect string here");
SqlCommad cmd=new SqlCommand("select * from table1 where key = @key",conn);
conn.Open();
Trans = conn.BeginTransaction();
cmd.Transaction=Trans;
cmd.Parameters.Add("@key",SqlDbType.Int);
cmd.Parameters["key"].Value = 1; // the parameter
myReader=cmd.ExecuteReader();
myReader.Read()
// here I set the breakpoint and fire the UpdateCommand in QA, which to my
disunderstanding updated the record in table1.
/
What am I doing wrong?
Regards,
Flemming