Exceptions when executing an SP - GetDate()

Posts   
 
    
obzekt
User
Posts: 60
Joined: 29-Apr-2004
# Posted on: 26-Jan-2007 13:32:48   

Hello. We have this simple stored procedure to retrieve the server's time:

CREATE PROCEDURE [GetCurrentDateTime]
AS
SELECT GETDATE() AS CurrentDateTime
GO

Then in code we do this:

DateTime dt = (DateTime)RetrievalProcedures.GetCurrentDateTime().Rows[0][0];

This works fine, but in production we (rarely) get this exception:

System.InvalidCastException: Specified cast is not valid.

or this one:

System.IndexOutOfRangeException: There is no row at position 0. at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) at System.Data.DataRowCollection.get_Item(Int32 index)

Any ideas? (We use LLBL v1.0.2005.1, SelfServicing and SQL2000/2005).

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 26-Jan-2007 15:27:21   

Would you please post the LLBLGen Pro runtimeLibrary version? Refer to the following thread for more details: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7722

Also post the stack trace of each exception especially the first.

obzekt
User
Posts: 60
Joined: 29-Apr-2004
# Posted on: 26-Jan-2007 15:45:38   

The ORM version is 1.0.20051.51222. The top of the stack traces is what I've posted. It doesn't drill down more. There are more statements in the trace of course, but it's our WinForms code leading to the RetrievalProcedures.GetCurrentDateTime call. As I said it happens only in production (occassionally), we haven't seen it during debugging.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 26-Jan-2007 16:02:14   

We haven't seen this error before, and I can't reproduce it. So it would be much of a help if you can re-produce it or hep us to re-produce it.

If not possible (as it seems), then I'm left with only one recommendation: try to use the latest version of the runtimeLibraries, you are using a very old version (a year old). It might be that something which was fixed later has an effect on this issue.