更新数据表未执行得很好 [英] Update datatable not executed well
本文介绍了更新数据表未执行得很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Oracle SQL Developer中,可以很好地执行以下语句:
In Oracle SQL Developer, the statement below can be executed well:
Update TRANSIT.OUR_USER Set PASSWORD = 'mar2015!' WHERE USERNAME = 'myUseName'
在我的ASP.Net项目中,
In my ASP.Net project,
public void UpdateRecord(OracleConnection connection, OracleDataAdapter da, DataTable tbl, string s) {
if (connection.State == ConnectionState.Closed)
connection.Open();
da.UpdateCommand = new OracleCommand();
da.UpdateCommand.CommandText = s; // s=the update statement above
da.UpdateCommand.Connection = connection;
da.Update(tbl.DataSet, tbl.TableName);
tbl.AcceptChanges();
try {
da.UpdateCommand.ExecuteNonQuery(); // executed long time w/o finishing
}
catch (Exception e) { }
}
但是当execete da.UpdateCommand.ExecuteNonQuery();
需要很长时间才能完成。怎样才能解决这个问题?谢谢。
But when execete da.UpdateCommand.ExecuteNonQuery();
it takes SO long time w/o finishing. How can this problem be solved? Thanks.
推荐答案
可以设置查询性能问题的原因,例如:LAN / WAN速度,应用程序和Oracle服务器设置等。
我建议阅读这些文章:
Oracle查询从.NET应用程序运行缓慢(或失败)但是SQL Developer的运行速度很快[ ^ ]
了解并行执行性能问题 [ ^ ]
It can be set of reason of query performance issues, such as: LAN/WAN speed, application and Oracle server settings, etc.
I'd suggest to read these articles:
Oracle query is slow (or fails) from .NET app but is fast from SQL Developer[^]
Understanding Parallel Execution Performance Issues[^]
这篇关于更新数据表未执行得很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文