Hello members of CodeProject,
I have a project, a database with employee information (name, town, birthday, HireDate, etc). I have add custom TextBox (on fly), and on that TextBox a code:

TexBox1.text = DateDiff("d", HireDateDateTimePicker.value, Now)

which is calculating how many days worker is working in company from HireDate, and Now.
I have put code on event TextBox1_TextChanged. But, this means that I need to move cursor in TextBox1 to apply changes.
I have also try with MouseMove. It works, but if I would have a huge database, then application will all the time reading script on MouseMove, and by that will slow down entire program.
Need someone to give a tip, example, etc...
Thank you in advance for help to anyone

just use the datediff with your sql query.. and all the rows will have the days in place of the whole date

Ok, cool, thank you, I will try it.

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.