|
Hi!
I've got a windows service that can be configured to use an access DB (for smaller installations) or a SQLServer DB (for larger installations).
The problem I'm facing at the moment is that usually after a (re)boot the SQL Server service isn't up and running completely at the moment my service is started.
Since my service is checking some values from the database on statup, it's choking regularly because SQL Server hasn't started my database yet.
Is there a way to influence the order in which services are started?
I've already tried to set my service's dependencies to make it depend on SQLEXPRESS, but to no avail. Looks as if SQLEXPRESS is already started, but my database hasn't been started yet.
Setting the options to restart the service after a failure doesn't work either - it only restarts the service when I shut it down via taskmanager for example, but not if the initial start of the service failed because the database wasn't available yet.
The problem occurrs with SQL Server 2005, I couldn't experience this behaviour with SQL Server 2000. Seems as if SQLServer 2000 started faster so the problem couldn't arise.
Any other idea what I could try?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Here's a snippet of some code I use to make sure sql server is running (actually msde, but same diff) locally ... maybe it will help:
private void CheckLocalDBService()
{
ServiceController[] services = ServiceController.GetServices() ;
foreach ( System.ServiceProcess.ServiceController cont in services)
{
if (cont.ServiceName.ToUpper().CompareTo("MSSQLSERVER") == 0)
{
SplashScreen.SetStatus("Found SQLSERVER service") ;
if (cont.Status != ServiceControllerStatus.Running)
{
SplashScreen.SetStatus("attempting to start SQLSERVER service") cont.Start() ;
cont.WaitForStatus(ServiceControllerStatus.Running,new TimeSpan(0,1,0)) ;
if (cont.Status == ServiceControllerStatus.Running)
{
_hasLocalMSDE = true ;
SplashScreen.SetStatus("SQL Server Service successfully started") ;
}
}
else
{
_hasLocalMSDE = true ;
}
}
}
}
|
|
|
|
|
Thanks, I'll try this approach.
I thought adding a dependency from SQL Server to my service would eventually have the same effect, but unfortunately, this didn't work. The SQL Server Service had been started before my service was started (the event log entries prove this), but my database wasn't available yet...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi,
I would like to know if it is possible to save a hashtable or an arraylist in the settings file?!
Thanks
|
|
|
|
|
May i know why u need this.
instead of u can serialize the hashtable object into some XML. and deserialze it whenever u need it.
|
|
|
|
|
Yes, you're right. But I wanted to use the settings file, because I already used it for other user settings and I thought it would be simplier to use only one config file!
|
|
|
|
|
A specified logon session does not exist. It may already have been terminated
this is the message that I am receiving when I am trying to map the other server. What usually is the solution or workaround for this one. I am stuck with it.
Any advice or ideas will help a lot.
Thanks
Dabuskol
|
|
|
|
|
Hi, all!!!
I created a simple WebBrowser, and now I need disable right mouse clicking, copy and select text in this WebBrowser.
If somebody knows how do it, please help me...
Thank's
|
|
|
|
|
Chek if there is a context menu property associated with the browser control. If yes, set the context menu property to null.This will disable right clicks
|
|
|
|
|
hi all,
my local ip is: 10.0.0.9 which i can find easily with reading some documents.
but i want to find how i will learn my outer ip ? (the ip i used when i surf the internet which is: 81.215.85.166 for my pc)
thanks in advance,
bye.
|
|
|
|
|
First of all never post valid ip addresses in the public domain, it can lead to some nasty things.
Since your using an router you'd have to either connect to the router and read the ip address from there or use a web site such as MyIPAddress.com to find it out.
You'd have to use an HTTPWebRequest to get the information, and then weed out your IP.
Unless anyone knows of a different way.
|
|
|
|
|
Look for a network class DNS. some of the methods are gethostbyname etc. You'll see one in there for retreiving your ip address.
|
|
|
|
|
Hi All!
Do you know about Multi Monitors.
I have a card Video have multi TV outputs.
I want to use only one PC to display to TVs.
pls, show me your solution.
Best regards.
---------------
I Don't want say no wealth.
|
|
|
|
|
|
Oh, Thank, I'm C# Developer.
I need a solution for my problem.
I want to write A software to control data thay display to Screen of TV by Card Convertor.
|
|
|
|
|
You need hardware, not C#.
|
|
|
|
|
No, I don't need hardware, I had hardware, But I have never software. Now, I have to develope a software. Do you know it. pls, send me source code if you have.
Thanks for your help.
Best regards.
|
|
|
|
|
Hello,
I have a problem with the SerialPort Control under VC# Express 2005.
In my application I have to read data from an external device through RS 232.
The process is built on a software-based handshaking which depends on the device.
The process has been implemented by me and works but unfortunately only the first time.
All data are donwloaded successfully as required.
The process is simple serialPort11.Open(), Handshaking, Data Download, Handshaking, serialPort1.Close().
The problem occurs with the second run, when the same procedure is executed again (using a button_onclick event), then the Port is opened again with serialPort1.Open() and with the first serialPort1.readByte() a TimeOut Error occurs.
Even if the Timeout is set to 10sec it does not help.
If the application is restarted and the process is again executed, then the data are read perfectly from the device. Hence it does not depend on the state of the external device, but on the PC (Soft and/or Hardware).
I have the feeling, that closing the SerialPort with serialPort1.Close() does not free all resources and possibly the hardware RS232 is not fully reset.
Has anyone had a similar problem and found a solution for it?
Can you rely on serialPort1.Close()? Are all resources freed?
I hope someone can help
Thanks a lot in advance
Best regards,
Carsten
|
|
|
|
|
Is there really no one who has discovered the same problem?
C.
Regards,
Carsten
|
|
|
|
|
Hello Friends,
An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module.
Additional information: [Resource lookup failed - infinite recursion detected. Resource name: Arg_NullReferenceException]
Has anyone come across this ?? I am working with a GDI+ user control where i do a bulk of drawing, say atleast 500 MB of data. This drawing is performed in a seperate thread from the main control thread with proper interruption techniques to stop drawing in between.
The problem am facing is, it works perfectly in Win XP environment, no issues. When it comes to Win 2000 the above mentioned exception pops in regularly when i try to interrupt the drawing thread.
can any help me out of this?? Even some clues will be a great help cos the error doesnt give any clue
Hariharan.T
|
|
|
|
|
Hey all,
I've been playing with this for two days now and I cannot get this to work. I have a form, two TabControls on the form. In one of the TabControls, I have a datagrid in there along with a textbox and a search button. I am trying to get the auto-resize anchor/dock functions working correctly, but nothing that I do seems to work. I've tried panels, splitters, using the Anchor/Dock methods every way I can think, but it never displays properly. Basically, it looks like this:
[SEARCH TEXT BOX] [SEARCH BUTTON]
* DATA GRID HERE TAKING UP REST OF THE SCREEN(TAB) *
I want it so that when the user resizes the form, it leaves the search text box and the search button on the top (not resize them and make them huge), but only resizes the datagrid to take up the remaining space. When I play with all the different features, the datagrid usually ends up overtaking the space where the search bar/button is, and it overlaps. I'm clueless as to how to make this work properly. Any help would be appreciated.
|
|
|
|
|
Hi shultas,
Give the following a try:
Search Text Box Settings
First, make sure the Dock property is set to "None".
Set the Anchor property to Left, Top, Right.
This should make the text box expand its width, but not its height when the form is expanded.
Search Button Settings
Again, make sure Dock is set to "None".
Set the Anchor property to Top, Right.
This should make the search button attach itself to the right side of the form when the form is expanded, but keep its width the same.
Data Grid Settings
Make sure Dock is set to "None".
Set the Anchor property to Left, Top, Right, Bottom.
This should make the data grid expand its width and height with the form when it is resized.
Tab Control Settings
I'm not sure where your two tab controls are positioned relative to the form, but you'll need to adjust the Anchor property of the tab control which contains the data grid, search text box, and search button. I think you'd probably want to set the Anchor property to Left, Top, Right, Bottom, so that it gets its share of the extra horizontal and vertical space when the form is expanded.
Give those settings a shot. If it doesn't work, please let me know and I'll try to help you as best I can.
Sincerely,
Alexander Wiseman
|
|
|
|
|
I do not seem to be getting any back when the host side of a socket connection closes softly....meaning..the app on the host side that is listening has closed, but the infrastructure is still present.
Even when I send a packet I'm not getting an exception. Any ideas?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
More information perhaps
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
At the line level there are two types of results from a socket close. A RST or a FIN (reset or fin). If you close a socket there is no data that should be seen at the application layer.
All network programming comes in two flavors Synchronous, and Asynchronous (from the application perspective). You say you don't get anything back? Change the close code to synchronous. You'll at least get an indicator back.
|
|
|
|