Click here to Skip to main content
15,887,304 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: easy question...... I am having dumb moment. Pin
jzonthemtn28-May-08 1:54
jzonthemtn28-May-08 1:54 
GeneralRe: easy question...... I am having dumb moment. Pin
Thomas Stockwell30-May-08 10:59
professionalThomas Stockwell30-May-08 10:59 
QuestionFile access sharing Pin
manisghouri27-May-08 4:36
manisghouri27-May-08 4:36 
AnswerRe: File access sharing Pin
Rob Smiley27-May-08 6:22
Rob Smiley27-May-08 6:22 
Questionhow to solve client machine crystal report error?? Pin
ranipriya 201027-May-08 3:05
ranipriya 201027-May-08 3:05 
RantRe: how to solve client machine crystal report error?? Pin
jzonthemtn27-May-08 9:05
jzonthemtn27-May-08 9:05 
AnswerCP Ignore: Repeat Offender Pin
leckey27-May-08 14:35
leckey27-May-08 14:35 
QuestionWindows Service - The service "started and then stopped" ?! Pin
007jb27-May-08 3:03
007jb27-May-08 3:03 
Hello,

I created a little Windows service with VB.NET 2008 (framework 3.5) that displays a message (I know, that's not very clean, but it's for debugging only...) each time a entry is added in a particular table of a database. The installation of the service succeeded, but when I try to start the service, I get the following message :
---------------------------
Services
---------------------------
The AlertSMS service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.
---------------------------
OK
---------------------------

Here's the code :
Public Class AlertSMS

    Protected Overrides Sub OnStart(ByVal args() As String)
        Dim time As System.Threading.Timer
        Dim callBack As New TimerCallback(AddressOf Timer_Tick)
        time = New System.Threading.Timer(callBack, Nothing, 0, 50)
        MsgBox("Le service surveille maintenant la table Alert...", MsgBoxStyle.Information, "Service démarré")
    End Sub

    Public Sub Timer_Tick(ByVal state As Object)
        'Parcours de la liste des entrées de la table Alert
        Dim allalerts As New DAL.AlertCollection
        allalerts.Load()
        For Each elem As DAL.Alert In allalerts.GetCollection()
            MsgBox("Nouvelle alerte : " + vbCrLf + "Message #" + elem.MsgID, MsgBoxStyle.Exclamation, "Attention")
            '*** Traitement de l'alerte ***
            elem.Delete()
            elem.Save()
        Next
    End Sub

End Class


Thanks in advance Wink | ;)

Etienne
AnswerRe: Windows Service - The service "started and then stopped" ?! Pin
Christian Graus27-May-08 3:16
protectorChristian Graus27-May-08 3:16 
GeneralRe: Windows Service - The service "started and then stopped" ?! Pin
007jb27-May-08 3:46
007jb27-May-08 3:46 
GeneralRe: Windows Service - The service "started and then stopped" ?! Pin
Rob Smiley27-May-08 6:27
Rob Smiley27-May-08 6:27 
AnswerRe: Windows Service - The service "started and then stopped" ?! Pin
Peter Josefsson Sweden27-May-08 15:30
Peter Josefsson Sweden27-May-08 15:30 
QuestionStart Up Code Pin
Jared774427-May-08 2:35
Jared774427-May-08 2:35 
AnswerRe: Start Up Code Pin
Christian Graus27-May-08 3:13
protectorChristian Graus27-May-08 3:13 
QuestionAppend or Insert the Text in Outlook 2003 message body using vb.net Pin
~Khatri Mitesh~27-May-08 0:28
~Khatri Mitesh~27-May-08 0:28 
QuestionPlease Help In VB 2008 Express Edition Pin
Abidh27-May-08 0:05
Abidh27-May-08 0:05 
AnswerRe: Please Help In VB 2008 Express Edition Pin
Ashfield27-May-08 1:23
Ashfield27-May-08 1:23 
GeneralRe: Please Help In VB 2008 Express Edition Pin
Abidh27-May-08 18:51
Abidh27-May-08 18:51 
GeneralRe: Please Help In VB 2008 Express Edition Pin
Ashfield27-May-08 23:15
Ashfield27-May-08 23:15 
GeneralRe: Please Help In VB 2008 Express Edition Pin
Abidh28-May-08 1:34
Abidh28-May-08 1:34 
GeneralRe: Please Help In VB 2008 Express Edition Pin
Ashfield28-May-08 5:03
Ashfield28-May-08 5:03 
QuestionError in Array Handling Pin
nagendrathecoder26-May-08 23:49
nagendrathecoder26-May-08 23:49 
AnswerRe: Error in Array Handling Pin
dan!sh 27-May-08 1:00
professional dan!sh 27-May-08 1:00 
AnswerRe: Error in Array Handling Pin
Chinners27-May-08 1:00
Chinners27-May-08 1:00 
AnswerRe: Error in Array Handling Pin
nagendrathecoder27-May-08 1:25
nagendrathecoder27-May-08 1:25 

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.