1
尝试连接并修改MySQL表中的现有数据。阅读工作正常,但当试图保存更改时,会发生以下错误。LightSwitch + MySQL错误:不支持嵌套事务
在提供程序连接上启动事务时发生错误。详情请参阅内部例外。内部异常消息: 不支持嵌套事务。
使用MySQL连接网络6.4.3
回答
我发现,在我的情况下,问题的解答。将以下代码添加到数据源代码
using System.Transactions;
namespace LightSwitchApplication
{
public partial class <ChangeThisToYourClassName>
{
private TransactionScope tx;
partial void SaveChanges_Executed()
{
tx.Complete();
}
partial void SaveChanges_Executing()
{
tx = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions {
IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted
});
}
}
}
试试看看这个答案︰http://stackoverflow.com/questions/1306869/are-nested-transactions-allowed-in-mysql –
This answer http:// stackoverflow .com/questions/7402946/lightswitch-does-not-allow-adding-or-modify-records-in-mysql提供了一个指向Microsoft修补程序的链接。 –