The following method is supposed to peroform a dirty read on an open connection. There are no transactions. Where do I set IsolationLevel?
public string DoDi
Given you already have an existing connection (and possibly an existing transaction), I'd use a TransactionScope to control the isolation level of the child. This does a dirty read rowcount (I believe):
using (var command = connection.CreateCommand())
using(new TransactionScope(TransactionScopeOption.RequiresNew, new TransactionOptions{IsolationLevel = IsolationLevel.ReadUncommitted}))
{
command.CommandText = string.Format("select count(*) from {0}", tableName);
return (int)command.ExecuteScalar();
}