1) Commandtimeout 0 gives you 1 second--it should be infinite, but it's not.
Set it to 15 or 30 and see if this fixes the problem. this is fixed in
Whidbey and some later builds.
2) I'm confused as to why it's failing on the access and not the
exectuereader, but this is when the data is actually moved from the server.
I suspect you're doing it to yourself with the Timeout=0.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"mac866" <(E-Mail Removed)> wrote in message
news:kgcrb.262293$(E-Mail Removed)...
> hi!
>
> I use
> - .net framework 1.1
> - sql server 2000 sp 3a
> - windows 2000 server
> - asp.net/c#
> - system.Data.SqlClient
> - latest sp's & hotfixes
>
> when I use a stored procedure (result 50 rows, execution time 2 seconds,
> about 600,000 rows in the table) in a c# code I'll get a "timeout expired"
> SqlException.
> ...
> myCommand.CommandType = CommandType.StoredProcedure;
> myCommand.CommandText = "sp_x";
> myCommand.CommandTimeout = 0;
> myReader = myCommand.ExecuteReader();
> while (myReader.Read())
> {
> x = myReader["x"].toString(); // <<-- TIMEOUT
> }
> ...
>
>
> the same sql in a "normal" select statement will work.
> ...
> myCommand.CommandType = CommandType.Text;
> myCommand.CommandText = "select x from ...";
> myCommand.CommandTimeout = 0;
> myReader = myCommand.ExecuteReader();
> while (myReader.Read())
> {
> x = myReader["x"].toString(); // <<-- OK
> }
> ...
>
> if I reduce the amount of rows (result about 5 rows, execution time less
> than 0.2 seconds, about 10,000 rows in the table) the stored procedure
will
> work in c#.
>
> but the "large" stored procedure will work with all other softwareproducts
> (like ms access, dts wizard, and so on).
>
> thanx for your help
> mac
>
>