From: Dom on
I have a program that runs about 10 SQL statements (INSERT
statements), each requiring about 2 hours. Sometimes I get a
Transport Error and the program dies. I'm not sure how to handle
this. In fact, I'm not sure what a transport error is, although I
assume it has something to do with hardware. It always happens in
SqlConnection.

My first idea is this:

1. Catch the error in the SqlConnection.Open() call.
2. Try again.
3. Repeat until it works, or just die after an arbitrary number of
times (say, 10).

Is this the best approach?

Dom
From: Dom on
Looking back on my original message, I think I should fill in some
details.

1. The program is written in CSharp, thus I can "catch" and "throw"
the SqlException Error that I get from SqlConnection.Open().

2. I am using the SqlClient within CSharp.

3. I am running on SS 2005, and I'm not sure of the SP level, but I
assume it is uptodate, since the manager is very good about that.
(But not good about listening to complaints like, "I keep getting a
"transport-level error").

On Jul 18, 11:16 am, Dom <dolivas...(a)gmail.com> wrote:
> I have a program that runs about 10 SQL statements (INSERT
> statements), each requiring about 2 hours.  Sometimes I get a
> Transport Error and the program dies.  I'm not sure how to handle
> this.  In fact, I'm not sure what a transport error is, although I
> assume it has something to do with hardware.  It always happens in
> SqlConnection.
>
> My first idea is this:
>
> 1.  Catch the error in the SqlConnection.Open() call.
> 2.  Try again.
> 3.  Repeat until it works, or just die after an arbitrary number of
> times (say, 10).
>
> Is this the best approach?
>
> Dom