Click here to Skip to main content
12,349,911 members (21,524 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# .NET SQL-Server , +
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.
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 14-Nov-12 19:19pm
Edited 15-Nov-12 18:55pm
v4

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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();
  Permalink  
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.)
biswarup88 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100