S
See Lim
Hi,
I'm using ReadUncommited level so that others can do a dirty read. But it
seems not to be working. What am I doing wrong here. Below is my test code:-
Thanks.
SqlConnection myConnection = new SqlConnection("Initial
Catalog=TEST;UID=sa;PWD=;Data Source=TEST;Connection Timeout=50;Connection
Lifetime=0;Max Pool Size=1000");
myConnection.Open();
SqlTransaction tr =
myConnection.BeginTransaction(IsolationLevel.ReadUncommitted, "test");
SqlCommand myCommand = new SqlCommand("insert into test (id,desp) values
(1000,'ddddd')", myConnection, tr);
myCommand.ExecuteNonQuery();
SqlConnection myConnection2 = new SqlConnection("Initial
Catalog=TEST;UID=sa;PWD=;Data Source=TEST;Connection Timeout=50;Connection
Lifetime=0;Max Pool Size=1000");
myConnection2.Open();
SqlCommand myCommand2 = new SqlCommand("select * from Seetest2",
myConnection2);
SqlDataAdapter D10 = new SqlDataAdapter(myCommand2);
DataTable DT10= new DataTable();
// I got a time out error when I try to do a Fill
D10.Fill(DT10);
I'm using ReadUncommited level so that others can do a dirty read. But it
seems not to be working. What am I doing wrong here. Below is my test code:-
Thanks.
SqlConnection myConnection = new SqlConnection("Initial
Catalog=TEST;UID=sa;PWD=;Data Source=TEST;Connection Timeout=50;Connection
Lifetime=0;Max Pool Size=1000");
myConnection.Open();
SqlTransaction tr =
myConnection.BeginTransaction(IsolationLevel.ReadUncommitted, "test");
SqlCommand myCommand = new SqlCommand("insert into test (id,desp) values
(1000,'ddddd')", myConnection, tr);
myCommand.ExecuteNonQuery();
SqlConnection myConnection2 = new SqlConnection("Initial
Catalog=TEST;UID=sa;PWD=;Data Source=TEST;Connection Timeout=50;Connection
Lifetime=0;Max Pool Size=1000");
myConnection2.Open();
SqlCommand myCommand2 = new SqlCommand("select * from Seetest2",
myConnection2);
SqlDataAdapter D10 = new SqlDataAdapter(myCommand2);
DataTable DT10= new DataTable();
// I got a time out error when I try to do a Fill
D10.Fill(DT10);