Click here to Skip to main content
15,914,163 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I filter records from the clock set at right angles
In data if I add a column is minute
Time from start plus column-minute
any help?
thanks a lot
 Imports System.Data.OleDb
Public Class Form1
Dim con As OleDbConnection
Dim dt As DataTable
Dim da As OleDbDataAdapter
Dim str As String = "Provider= Microsoft.Jet.OLEDB.4.0;Data Source = " & Application.StartupPath & "\Nwind.mdb;"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim conn As OleDbConnection = New OleDbConnection(str)
conn.Open()
Dim dt As DataTable = New DataTable()
For Each _row As DataRow In dt.Rows
Dim _now As DateTime = Now
_now = _now.AddMinutes(_row("Duration"))
Dim sQry1 As String = "select * from tblTimeLoad where Start='" & _now.ToString("yyyy-MM-dd hh:mm:ss tt") & "'"
Dim da As OleDbDataAdapter = New OleDbDataAdapter(sQry1, conn)
da.Fill(dt)
DataGridView1.DataSource = dt
Next
conn.Close()
End Sub
End Class

https://www.mediafire.com/?mk4v9cvcm47u29n[^]
Posted
Comments
OriginalGriff 26-Oct-14 4:12am    
That doesn't make a whole lot of sense to me at the moment: perhaps if you explain what you are trying to do, and what results you get? What happens that you don't expect, or doesn't happen that you do?
[no name] 26-Oct-14 13:22pm    
I suggest you strongly consider using parametrized queries, and why are you selecting queries from inside a tick event?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900