Click here to Skip to main content
15,883,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
disconnected sql server when run stored procedure.
when i try to create or alter stored procedure it automatically disconnected dbserver.

only for stored procedure create,alter.

this error I am get it.
SQL
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)

How to solve this issue...

Thanks,
Karthikeyan,Bangalore.
Posted
Updated 15-Nov-12 18:55pm
v4

1 solution

Here is an example; put your code inside that conn.open() and conn.close().
Hope it works.
conn.Open();
SqlCommand cmd = new SqlCommand(@"select _regno from _registration", conn);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
dt = new DataTable();
ada.Fill(dt);
conn.Close();
 
Share this answer
 
Comments
pkarthionline 16-Nov-12 0:54am    
Only sql server alter,create .i Get this error .

A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
sahabiswarup 17-Nov-12 0:27am    
have you tried the above code format?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900