Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AseException: The command has timed out.

329 views
Skip to first unread message

las

unread,
Jul 30, 2011, 11:15:44 AM7/30/11
to
I am getting an exception when I try to run a long running stored procedure.
AseException: The command has timed out.
Does anyone know what is wrong? Can I change the time out length?

Full error
Sybase.Data.AseClient.AseException: The command has timed out.
at Sybase.Data.AseClient1.AseCommand.CheckResult(Int32 res)
at Sybase.Data.AseClient1.AseCommand.Execute()
at Sybase.Data.AseClient1.AseCommand._ExecuteReader(CommandBehavior commandBehavior)
at Sybase.Data.AseClient.AseCommand.ExecuteReader()
at PrimusFeed.Posititions.GetPositions(DateTime date) in Posititions.cs: line 40
at TestPrimusFeed.PositionsTest.TestGetPositions() in PositionsTest.cs: line 66

I am running on Windows 7 64 bit with ADONET driver version 2.155.1000.0.

My code looks like this:
using System;
using System.Data;
using Sybase.Data.AseClient;

namespace Feed
{
public class myClass
{
public static void Test(DateTime date)
{
var ConnectionString =
"Driver={SYBASE ASE ODBC Driver};" +
"database=pldb;" +
"server=myserver;"+
"port=8865;" +
"uid=username;" +
"pwd=XXX;" +
"ConnectionIdleTimeout=0";

var sqlConnection1 = new AseConnection(ConnectionString);
Console.WriteLine("Driver version : " + AseConnection.DriverVersion);

string[] modes = { "MODE1" };

foreach (var mode in modes)
{
var cmd = new AseCommand
{
CommandText = "database..storedproc1",
CommandType = CommandType.StoredProcedure,
Connection = sqlConnection1
};
var d = date.ToString("yyyyMMdd");
cmd.Parameters.Add("@dt_eff", d);
cmd.Parameters.Add("@nm_rpt", mode);

sqlConnection1.Open();

var reader = cmd.ExecuteReader();
while (reader.Read())
{
// Dump results out on concole for now..
for (var i = 0; i < reader.FieldCount; i++)
{
if (reader.IsDBNull(i))
Console.Write(";");
else
Console.Write(reader.GetString((i)) + ";");
}
Console.WriteLine();
}
}

sqlConnection1.Close();
}
}
}

void Main()
{
MyClass.Test(new DateTime(2011, 7, 14));
}

las

unread,
Jul 30, 2011, 11:21:27 AM7/30/11
to
0 new messages