Imports System.Data.SqlClient Public Class frm_secure_mornning Dim current_datetime As DateTime Private Sub frm_secure_mornning_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Timer1.Interval = 1000 Timer1.Enabled = True End Sub Cn.Open() Dim cmd As New SqlCommand("select GetDate();", Cn) current_datetime = cmd.ExecuteScalar Cn.Close() End Sub Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick lblDatetime.Text = current_datetime End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)