G
Guest
I have a very long stored procedure "runMRP".
approx 1000 lines and can runs for 30 minutes at Query Analyser.
It runs sucessfully at query analyser with all the result.
It runs successfully on osql.
It runs fine from VB.Net program on small data set. (with less than few sec
running time)
It always crushes when I runs from VB.Net program with large data set. The
Exception catch from VB.Net side (SQLException) is "Cursor is READONLY. The
statement has been terminated.".
The code is a simple data adaptor call:
objCmd = objConn.CreateCommand
objCmd.CommandText = "runMRP"
objCmd.CommandType = CommandType.StoredProcedure
objCmd.CommandTimeout = 0
objAdp.SelectCommand = objCmd
objAdp.Fill(myDs) ' fail here
I use VS 2005, .Net 2.0 and SQL Server 2000.
1. I have set the CommandTimeout to 0 (and at the SQL server side, I set the
Query Timeout to 0), is there any other place that timeout could occur?
2. I have great difficulty to debug this problem. At VB.Net side, when I
trace to objAdp.Fill line, it will pass to SQL Server to execute the command.
I have no way to know what is going on. At the SQL Server side, I can't see
what is going on. Is there any tools that can help?
3. Any suggestion to solve this problem?
regards
Locus
approx 1000 lines and can runs for 30 minutes at Query Analyser.
It runs sucessfully at query analyser with all the result.
It runs successfully on osql.
It runs fine from VB.Net program on small data set. (with less than few sec
running time)
It always crushes when I runs from VB.Net program with large data set. The
Exception catch from VB.Net side (SQLException) is "Cursor is READONLY. The
statement has been terminated.".
The code is a simple data adaptor call:
objCmd = objConn.CreateCommand
objCmd.CommandText = "runMRP"
objCmd.CommandType = CommandType.StoredProcedure
objCmd.CommandTimeout = 0
objAdp.SelectCommand = objCmd
objAdp.Fill(myDs) ' fail here
I use VS 2005, .Net 2.0 and SQL Server 2000.
1. I have set the CommandTimeout to 0 (and at the SQL server side, I set the
Query Timeout to 0), is there any other place that timeout could occur?
2. I have great difficulty to debug this problem. At VB.Net side, when I
trace to objAdp.Fill line, it will pass to SQL Server to execute the command.
I have no way to know what is going on. At the SQL Server side, I can't see
what is going on. Is there any tools that can help?
3. Any suggestion to solve this problem?
regards
Locus