Re: Waiting for MSDE
From: Jeff (jeff_nospam_at_eNetPortals.com)
Date: 08/26/04
- Next message: Eric Sabine: "Re: cannot create default instance"
- Previous message: nataliaNY: "Re: Installation failure"
- In reply to: Steven Cheng[MSFT]: "Re: Waiting for MSDE"
- Next in thread: Steven Cheng[MSFT]: "Re: Waiting for MSDE"
- Reply: Steven Cheng[MSFT]: "Re: Waiting for MSDE"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Aug 2004 16:42:58 GMT
Thanks Steven -
Problem solved.
I still don't understand why a connection open must wait several seconds
after the service reports 'Running'. Can you explain what's going on???
- Jeff
"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:fZoTXAziEHA.3628@cpmsftngxa10.phx.gbl...
> Hi Jeff,
>
> In addition to wait for a certain period of time, I think we can also try
> another means on this. Since if the service hasn't been started, we'll get
> failed(exception) when intializing the SqlConnection, yes?
>
> Thus, we can define a function to do the connection initializing, it use a
> try{...}catch(){...} block in it, and when get error , checking the
> exception type, if it means the service not completely started, return a
> certain value.
>
> And in the function's caller, use a while loop the constantly make the
> intialization call. For example:
> ==================================
> Function MSDE_INIT() As Integer
>
>
> Try
> frmMain.conSC = New SqlConnection(strConn)
> frmMain.conSC.ConnectionString = strConn
> frmMain.conSC.Open()
> Return 1
> Catch ex As Exception
> 'exception checking
>
> Return 0
> End Try
> End Function
> =======================================
>
> call it as
>
> While Not MSDE_INIT() = 1
>
> End While
>
> Also, you can sleep for serveral seconds in the while loop if you feel it
> will block your application
>
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
>
>
- Next message: Eric Sabine: "Re: cannot create default instance"
- Previous message: nataliaNY: "Re: Installation failure"
- In reply to: Steven Cheng[MSFT]: "Re: Waiting for MSDE"
- Next in thread: Steven Cheng[MSFT]: "Re: Waiting for MSDE"
- Reply: Steven Cheng[MSFT]: "Re: Waiting for MSDE"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|