Skip to content Skip to sidebar Skip to footer

Why Am I Getting "timeout" And "cannot Find Table 0" And What Preventive Measures Are At My Disposal?

In the answer to a previous question here, I was advised to also ask about this related issue. Once in awhile, the report generation code I have throws two exceptions (they don't d

Solution 1:

The errors are because the Fill or the open part here

try
{
    cmd.Connection.Open();
    new SqlDataAdapter(cmd).Fill(ds);
}

is timing out but since you handle the exception the execution ends up hitting the return statement where you are trying to return a table from the still null table collection of the dataset.

The timeout can happen for many reasons. Probably need more info for that but if you use the sql profiler in management studio you should be able to get an idea on if the connection opens, is proc called, how longs its trying to run and what part is causing the timeout. If it works elsewhere capture your input params and try those out directly.

Also setting a timeout of 0 should give you the max possible.

Post a Comment for "Why Am I Getting "timeout" And "cannot Find Table 0" And What Preventive Measures Are At My Disposal?"