用于C#编程时对数据库进行操作的类名。C# 中位于SqlClient中的一个类。表示要对SQLSERVER数据库进行操作。 SqlCommand对象允许你指定在数据库上执行的操作的类型。比如,你能够对数据库中的行数据执行select,insert,modify以及delete命令。SqlCommand对象能被用来支持断开连接数据管理的情况,可以只单独使用SqlCommand对象。也可以与SqlDataAdapter一起实现断开数据连接,实现操作数据库的应用程序。
How does that SqlCommand know about the Transaction created earlier?
但SqlCommand如何知道先前创建的Transaction ?
In reality, the mechanism used by TransactionScope and SqlCommand is more complicated, but at its core the premise is sound.
实际上,TransactionScope和SqlCommand所使用的机制非常复杂,但核心是前提要合理。
You can imagine that TransactionScope could be using static fields to store the current Transaction and that SqlCommand could just be picking up that Transaction from that static field.
您可以假设TransactionScope可以使用静态字段来存储当前的Transaction,而SqlCommand只从该静态字段中获取相应Transaction。
用于C#编程时对数据库进行操作的类名。C# 中位于SqlClient中的一个类。表示要对SQLSERVER数据库进行操作。 SqlCommand对象允许你指定在数据库上执行的操作的类型。比如,你能够对数据库中的行数据执行select,insert,modify以及delete命令。SqlCommand对象能被用来支持断开连接数据管理的情况,可以只单独使用SqlCommand对象。也可以与SqlDataAdapter一起实现断开数据连接,实现操作数据库的应用程序。
应用推荐