i have to generate a reminder to the user alerting about payment due dates.
i am doing it using a label control which is placed in the main page, so just after he logged in, the DB will be checked for due dates and if any date is nearing , the reminder will be generated


is there any other way to send an alert or a reminder itself in VB ?

Dani AI

Generated

Good start, , and useful nudge from — making the reminder more noticeable is the right instinct. Below are safe, practical alternatives and a couple of short VB.NET snippets you can adapt depending on whether your app is a desktop client or a server/web app.

Consider the delivery and timing first:

  • If users must be notified even when not logged in, send email or SMS from a scheduled job (Windows Service, Task Scheduler, SQL Agent or a cloud function).
  • If you only need to notify active sessions, use a push mechanism (SignalR / WebSockets for web apps, or OS toast notifications for desktop apps).
  • Avoid relying on in-process timers inside ASP.NET: app pool recycles stop them. Use an external scheduler or a background-job framework for reliability.

Example: pull due items from the database, then send email reminders. Adjust connection strings, thresholds and error handling for production.

Imports System.Data.SqlClient

Function GetDueReminders(conn As String, daysAhead As Integer) As DataTable
    Dim dt As New DataTable()
    Using cn As New SqlConnection(conn)
        cn.Open()
        Using cmd As New SqlCommand("SELECT UserEmail, DueDate FROM Payments WHERE DueDate BETWEEN @now AND @threshold", cn)
            cmd.Parameters.AddWithValue("@now", DateTime.UtcNow)
            cmd.Parameters.AddWithValue("@threshold", DateTime.UtcNow.AddDays(daysAhead))
            Using rdr As SqlDataReader = cmd.ExecuteReader()
                dt.Load(rdr)
            End Using
        End Using
    End Using
    Return dt
End Function
Imports System.Net.Mail

Sub SendReminderEmail(toAddr As String, subject As String, body As String)
    Using msg As New MailMessage("noreply@yourdomain.com", toAddr)
        msg.Subject = subject
        msg.Body = body
        Using smtp As New SmtpClient("smtp.yourhost.com", 587)
            smtp.Credentials = New System.Net.NetworkCredential("user", "pass")
            smtp.EnableSsl = True
            smtp.Send(msg)
        End Using
    End Using
End Sub

Operational tips: respect user time zones, allow opt-outs, throttle sends to avoid spam flags, secure credentials (do not hard-code), log attempts and implement retries. For web apps that need instant in-page alerts, combine server-side jobs with a push channel so logged-in users get real-time notices while others receive email/SMS.

Recommended Answers

All 2 Replies

is there any other way to send an alert or a reminder itself in VB ?

I read the question as that you are wondering how else you can alert the user to the reminder?
You could trigger a popup (msgbox) or a new form purposely for displaying alerts. This is an alternative to just updating a label on a form.

thanx very much i think thats a btter way of having an alert

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.