Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
AnswerRe: TypeInitializationException was unhandled? Pin
PIEBALDconsult18-Dec-08 16:32
mvePIEBALDconsult18-Dec-08 16:32 
QuestionN-Tier DataTable Validation... Pin
Illegal Operation18-Dec-08 12:16
Illegal Operation18-Dec-08 12:16 
QuestionHow to handle errors right? Pin
skyline9218-Dec-08 11:39
skyline9218-Dec-08 11:39 
AnswerRe: How to handle errors right? Pin
Christian Graus18-Dec-08 11:45
protectorChristian Graus18-Dec-08 11:45 
AnswerRe: How to handle errors right? Pin
Expert Coming18-Dec-08 11:47
Expert Coming18-Dec-08 11:47 
AnswerRe: How to handle errors right? Pin
led mike18-Dec-08 12:21
led mike18-Dec-08 12:21 
QuestionHttpWebRequest with Client certs Pin
kicknit218-Dec-08 11:15
kicknit218-Dec-08 11:15 
Questionconnecting to sqlConnection after restarting SQL server process fails Pin
calanit18-Dec-08 10:06
calanit18-Dec-08 10:06 
Hi All,

after updating the remote access priviliges of my sql server,
I am restarting the MSSQLSERVER using this code:

ManagementObject svc ... finding MSSQLSERVER
...
svc.Get();
if ((uint)svc.GetPropertyValue("State") != sqlServiceStopped)
{
svc.InvokeMethod("StopService", null);
svc.InvokeMethod("StartService", null);
}

I also start the SQLAgent process that stops when stopping the MSSQLSERVER.

I can see that all the processes are up and running, but my application
fails at the ExecuteReader line:

sqlConnection = new SqlConnection(connectionString);
sqlConnection.Open();

SqlCommand sqlCommand = new SqlCommand("select xx from xxs",sqlConnection);

SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(CommandBehavior.CloseConnection);

this is the exception that I am getting:
{"A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)"}

Why is that Confused | :confused: ?
What should I do to over come it ?


Thanks
Calanit
AnswerRe: connecting to sqlConnection after restarting SQL server process fails Pin
Dave Kreskowiak18-Dec-08 10:15
mveDave Kreskowiak18-Dec-08 10:15 
GeneralRe: connecting to sqlConnection after restarting SQL server process fails Pin
calanit18-Dec-08 10:27
calanit18-Dec-08 10:27 
QuestionRe: connecting to sqlConnection after restarting SQL server process fails Pin
led mike18-Dec-08 10:29
led mike18-Dec-08 10:29 
AnswerRe: connecting to sqlConnection after restarting SQL server process fails Pin
calanit18-Dec-08 10:40
calanit18-Dec-08 10:40 
GeneralRe: connecting to sqlConnection after restarting SQL server process fails Pin
Dave Kreskowiak18-Dec-08 10:45
mveDave Kreskowiak18-Dec-08 10:45 
GeneralRe: connecting to sqlConnection after restarting SQL server process fails Pin
calanit18-Dec-08 11:03
calanit18-Dec-08 11:03 
QuestionGet rid of label margins Pin
Tony Pottier18-Dec-08 8:23
Tony Pottier18-Dec-08 8:23 
AnswerRe: Get rid of label margins Pin
#realJSOP18-Dec-08 8:33
professional#realJSOP18-Dec-08 8:33 
AnswerRe: Get rid of label margins Pin
Dave Kreskowiak18-Dec-08 8:33
mveDave Kreskowiak18-Dec-08 8:33 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 8:43
Tony Pottier18-Dec-08 8:43 
GeneralRe: Get rid of label margins Pin
Dave Kreskowiak18-Dec-08 9:04
mveDave Kreskowiak18-Dec-08 9:04 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 9:06
Tony Pottier18-Dec-08 9:06 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 9:37
Tony Pottier18-Dec-08 9:37 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 9:58
Tony Pottier18-Dec-08 9:58 
GeneralRe: Get rid of label margins Pin
DaveyM6918-Dec-08 11:21
professionalDaveyM6918-Dec-08 11:21 
GeneralRe: Get rid of label margins Pin
Tony Pottier18-Dec-08 11:27
Tony Pottier18-Dec-08 11:27 
GeneralRe: Get rid of label margins Pin
Luc Pattyn18-Dec-08 12:50
sitebuilderLuc Pattyn18-Dec-08 12:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.