Groups | Blog | Home
all groups > sql server clients > september 2007 >

sql server clients : A transport-level error when calling SqlCommand.ExecuteNonQuery()


Roy
9/28/2007 1:12:01 PM
I have a stored procedure with some input parameter and one output parameter.
I use SqlCommand and SqlParameter as following

///Set some imput parameters here

parameter = cmd.CreateParameter();
parameter.ParameterName = "OutputParameter";
parameter.DbType = DbType.String;
parameter.Size = 16;
parameter.Direction = ParameterDirection.Output;
cmd.Parameters.Add(parameter);

cmd.ExecuteNonQuery();


However, the last statement generate the following error and the connection
closed because of that:

A transport-level error has occurred when receiving results from the server.
(provider: TCP Provider, error: 0 - The specified network name is no longer
available.)

Ekrem_Önsoy
9/29/2007 12:00:00 AM
It look you lost connection with the SQL Server.

You may get this error when you were working with SSMS too. You click New
Query and type queries against your database but when your connection
expries, you get that error and you need to click that New Query button to
establish a new connection to your SQL Server.

You may want to increase connection timeout in your connection string.

--
Ekrem Önsoy



[quoted text, click to view]
AddThis Social Bookmark Button