#12003/3/1 19:00:39
小弟对ASP。NET用的不多,现在数据库编程时遇到一个问题,急要向导师交工,请高人指点,先谢谢了:
如何处理这种异常????急死我了????
错误提示为:
分布式事务已完成。请将此会话登记到新事务或 NULL 事务中。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: 分布式事务已完成。请将此会话登记到新事务或 NULL 事务中。
Source Error:
Line 268: dim ds as dataset = new dataset()
Line 269: MyCommand = New SqlDataAdapter(strSelect, MyConnection)
Line 270: MyCommand.Fill(ds,"T_MYCLASS")
Line 271: dim i as integer = ds.tables("T_MYCLASS").rows.count
Line 272: if i< 1 then
Stack Trace:
[SqlException: 分布式事务已完成。请将此会话登记到新事务或 NULL 事务中。]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +643
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +9
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP.StudentExeUpload_aspx.oninit_txtTeacherID(Object sender, EventArgs e) in c:\inetpub\wwwroot\TEMP\DEFAULT.aspx:270
System.Web.UI.Control.OnInit(EventArgs e) +67
System.Web.UI.Control.InitRecursive(Control namingContainer) +235
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Page.ProcessRequestMain() +171