473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Display Data on form when timer control is running

54
I need help. My problem is I'm using visual basic.net 2008 and SQL server 2008. Now, the result the function below returns is the total number of records in the DataGridView based on the SQL query.
My problem now is, I want the value of frmBlinker.lblMessage.Text &= Table.Rows.Count.ToString.Trim & " file(s) to receive."
should get displayed as a notification to a user time to time. The problem is when I give the value of frmBlinker.lblMessage.Text &= Table.Rows.Count.ToString.Trim & " file(s) to receive." to a timer control so that it checks whether
new files have been sent to the user, the form on which the total no. of files get disoplayed, freezees as a result of the timer control that keeps track of the records in the database if new record has been sent to the user. How do I please dispaly the result on the form while the timer is running and does not freeze the form, users do data entry on that form?

Thanks in advance.
Expand|Select|Wrap|Line Numbers
  1. Public Function TrackMovementOfFiles() As String
  2.         strUsername = GetSetting("Lands", "Connection", "DataL1")
  3.         strPassword = GetSetting("Lands", "Connection", "DataL2")
  4.         strServerName = GetSetting("Lands", "Connection", "DataL3")
  5.         strInitialCatalog = GetSetting("Lands", "Connection", "DataL4")
  6.         DataL1 = strUsername & strPassword & "Connect Timeout=0; " & strServerName & strInitialCatalog
  7.         Dim strQuery As String = "Select * from File_Movement where Movement_To='" & frmHome.txtUserName.Text.Trim & "' and Movement_Status='" & "Not Receipted" & "' and fdate > '2010-1-30' order by FDate desc, Ftime desc"
  8.         SQLCon = New SqlConnection(DataL1)
  9.         dTable = New DataSet
  10.         daAdapter = New SqlDataAdapter(strQuery, SQLCon)
  11.         daAdapter.Fill(dTable, "File_Movement")
  12.         Dim Table As DataTable = dTable.Tables("File_Movement")
  13.         If Table.Rows.Count > 0 Then
  14.             frmBlinker.lblMessage.Text = ""
  15.             frmBlinker.lblMessage.Text = "You have "
  16.             frmBlinker.lblMessage.Text &= Table.Rows.Count.ToString.Trim & " file(s) to receive."
  17.             Return Blinker.lblMessage.Text.ToString
  18.         End If
  19.         Return Nothing
  20. End Function
May 4 '10 #1
0 1166

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
11
by: bala | last post by:
hi!!! i need to display a disclaimer which is two page in length in a word document. i also need to format the text. the idea is something as follows on opening the application, a form which...
6
by: lauren quantrell | last post by:
I am using a timer to display the time it takes a user to complete a file transfer using the code below. The code below will display the total elapsed time, but is there a way to update the time...
1
by: Mamatha | last post by:
Hi I am developing a small application to capture a record a video file through webcam in C#.NET. In this application i created a JPEG images for every slide,means every JPEG image was treated...
6
by: Gene Hubert | last post by:
I seem to be getting crazy results when I have multiple System.Windows.Forms.Timer objects in the same form running at the same time. When only one timer is running I get the expected behavior. ...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
1
by: John Phelan-Cummings | last post by:
When I add the name of a new individual in a, bound form, it will not display that person’s name in a label control of a second unbound form. I have a scheduling program that I am working on. ...
9
by: Suman | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
4
by: Bill McCormick | last post by:
Hello, A timer control (I think) runs in another thread apart from a main form. In the OnTick event, you can update some form control with no worries. I'm making an AsyncronousServer class...
9
by: tshad | last post by:
I have a Windows App that is doing some work and then writing a "Now Processing..." line to the status line of the window as well as the Textbox on the form. But the problem is that the work is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.