Click here to Skip to main content
15,920,602 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHelp with "OutOfMemoryException" Pin
Juan Patrick29-Apr-08 16:24
Juan Patrick29-Apr-08 16:24 
AnswerRe: Help with "OutOfMemoryException" Pin
Christian Graus29-Apr-08 19:37
protectorChristian Graus29-Apr-08 19:37 
GeneralRe: Help with "OutOfMemoryException" Pin
Juan Patrick29-Apr-08 20:17
Juan Patrick29-Apr-08 20:17 
GeneralRe: Help with "OutOfMemoryException" Pin
Christian Graus29-Apr-08 20:33
protectorChristian Graus29-Apr-08 20:33 
GeneralRe: Help with "OutOfMemoryException" Pin
Guffa29-Apr-08 23:03
Guffa29-Apr-08 23:03 
GeneralRe: Help with "OutOfMemoryException" Pin
Juan Patrick30-Apr-08 13:22
Juan Patrick30-Apr-08 13:22 
GeneralRe: Help with "OutOfMemoryException" Pin
Christian Graus30-Apr-08 13:36
protectorChristian Graus30-Apr-08 13:36 
QuestionWindows Service not working Pin
svanwass29-Apr-08 15:54
svanwass29-Apr-08 15:54 
Rather simple windows service that has a timer set to 1 minute from NOW and when that time is reached, writes an event log entry. That was the idea, but nothing happens.

Anybody know what i am doing wrong?


<br />
Public Class Service1<br />
    Private alarmTime As Date<br />
    Protected Overrides Sub OnStart(ByVal args() As String)<br />
        ' Add code here to start your service. This method should set things<br />
        ' in motion so your service can do its work.<br />
        'Dim a As TimeSpan = Date.Now.Subtract(Date.Today.AddDays(1))<br />
        'Dim tomorrow As Date = New Date<br />
        'tomorrow = Date.Now.AddDays(1)<br />
<br />
        'Me.alarmTime = New Date(tomorrow.Year, tomorrow.Month, tomorrow.Day, 0, 1, 1, 1)<br />
        Me.alarmTime = Date.Now.AddMinutes(1)<br />
        Me.Timer1.Start()<br />
    End Sub<br />
<br />
    Protected Overrides Sub OnStop()<br />
        ' Add code here to perform any tear-down necessary to stop your service.<br />
    End Sub<br />
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />
        If alarmTime < Date.Now Then<br />
            Me.Timer1.Stop()<br />
            Dim MyLog As New EventLog() ' create a new event log<br />
            ' Check if the the Event Log Exists<br />
            If Not Diagnostics.EventLog.SourceExists("SQLBackup") Then<br />
                Diagnostics.EventLog.CreateEventSource("SQLBackup", "SQLBackup") ' Create Log<br />
            End If<br />
            MyLog.Source = "SQLBackup"<br />
            ' Write to the Log<br />
            Diagnostics.EventLog.WriteEntry("SQLBackup", "Event fired at " & CStr(TimeOfDay), EventLogEntryType.Information)<br />
        Else<br />
            Dim remainingTime As TimeSpan = Me.alarmTime.Subtract(Date.Now)<br />
<br />
            'Me.Label1.Text = String.Format("{0}:{1:d2}:{2:d2}", _<br />
            'remainingTime.Hours, _<br />
            'remainingTime.Minutes, _<br />
            'remainingTime.Seconds)<br />
        End If<br />
    End Sub<br />
End Class<br />

QuestionSQL help [modified] Pin
bapu288929-Apr-08 9:41
bapu288929-Apr-08 9:41 
AnswerRe: SQL help Pin
Ray Cassick29-Apr-08 11:54
Ray Cassick29-Apr-08 11:54 
QuestionRe: SQL help Pin
bapu288930-Apr-08 8:03
bapu288930-Apr-08 8:03 
AnswerRe: SQL help Pin
Ray Cassick30-Apr-08 8:37
Ray Cassick30-Apr-08 8:37 
QuestionRe: SQL help Pin
bapu28891-May-08 8:32
bapu28891-May-08 8:32 
AnswerRe: SQL help Pin
Ray Cassick1-May-08 11:02
Ray Cassick1-May-08 11:02 
AnswerRe: SQL help Pin
bapu28892-May-08 9:29
bapu28892-May-08 9:29 
GeneralRe: SQL help Pin
Ray Cassick2-May-08 9:37
Ray Cassick2-May-08 9:37 
GeneralSending text to the printer Pin
MikeMarq29-Apr-08 8:40
MikeMarq29-Apr-08 8:40 
AnswerRe: Sending text to the printer Pin
Smithers-Jones29-Apr-08 8:53
Smithers-Jones29-Apr-08 8:53 
GeneralRe: Sending text to the printer Pin
MikeMarq29-Apr-08 15:40
MikeMarq29-Apr-08 15:40 
AnswerRe: Sending text to the printer Pin
Smithers-Jones29-Apr-08 21:33
Smithers-Jones29-Apr-08 21:33 
GeneralRe: Sending text to the printer Pin
MikeMarq30-Apr-08 2:10
MikeMarq30-Apr-08 2:10 
AnswerRe: Sending text to the printer Pin
Smithers-Jones30-Apr-08 3:04
Smithers-Jones30-Apr-08 3:04 
QuestionHow to write a help-assistant like office Assistant? Pin
MaWeRic29-Apr-08 4:59
MaWeRic29-Apr-08 4:59 
AnswerRe: How to write a help-assistant like office Assistant? Pin
Zaegra29-Apr-08 8:41
Zaegra29-Apr-08 8:41 
GeneralRe: How to write a help-assistant like office Assistant? Pin
MaWeRic4-May-08 22:47
MaWeRic4-May-08 22:47 

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.