小知识点分享:
静态变量
private static string ConnectionName= "CurrnetConnection";
public void StartTransation()
{
//set current connection and transaction to current thread
Thread.SetData(Thread.GetNamedDataSlot("ConnectionName"), "value1");
}
//读当前线程中保存的值
string strValue= (string)Thread.GetData(Thread.GetNamedDataSlot("ConnectionName"));