Timeout problem, please help - Stored procedure.sql [0/1]

  • Thread starter Thread starter Giovanni
  • Start date Start date
G

Giovanni

[This followup was posted to microsoft.public.dotnet.framework.adonet and a copy was sent to the cited author.]

Hello everybody.
I have a problem with ADO.NET when I try to connect to a SQL server
database.
My C# code call a stored procedure that is used to normalize a database
in which there are a lot of mistakes (some record are lower case but
some other are upper case etc).
The stored procedure works fine in SQL analyzer, but when I try to use
it in C# I have a timeout error.
In effect when I run the procedure using osql I must wait 5 minutes to
complete the operation(there are a lot of record inside the table that I
must normalize) but I don't know what I must do to work with my stored
procedure in C#. I tried to set connection timeout=600 but after 2
minutes the C# program stops and I have a SqlException
I don't know what to do, do you have some idea?
The server is correctly connected, it responds to my instructions
(
Console.WriteLine(mySqlConnection.WorkstationId);
Console.WriteLine(mySqlConnection.ConnectionString);
)
The attachments are the stored procedure and the C# code that I use,
thanks in advance to everybody.
PS the stored procedure isn't the original (that's complicated) but only
a "toy" that however block my application!
I know in advance that this it an idiot problem, but I did't arrive to
resolve it!
PPS the table reparto used by the stored procedure is composed by 328128
record
 
Hi Giovanni,

Did you try setting SqlCommand.CommandTimeout property?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Giovanni said:
[This followup was posted to microsoft.public.dotnet.framework.adonet and
a copy was sent to the cited author.]
 
"Miha Markic [MVP said:
Hi Giovanni,

Did you try setting SqlCommand.CommandTimeout property?
Thank you a lot, this was my fault, I set up only the connection
timeout!
Good bye!!!
 
Back
Top