• Deutsch

  • English

  • Español

  • Français

  • Italiano

  • Português

#1 Non-invasive monitoring

Vb.net Code To | Retrieve Data From Sql Server

WorkTime is non-invasive (without going too far) employee monitoring system. HIPAA & GDPR safe.

WorkTime

For Windows, macOS

Terminal/Citrix

Cloud, on-premise

1 to 15,000+ computers

In-office, hybrid, remote

WorkTime WorkTime WorkTime WorkTime
WorkTime WorkTime WorkTime WorkTime
WorkTime WorkTime
Amika
School district
Dukascopy
Toyota
Coutts
Universal

26

Years of experience

Trusted by 9,500+ global brands and organizations

Main features

Improve employee attendance, active time, productivity instantly

Good attendance, good active time, good employee productivity—things are going well in your team with WorkTime!

Special features

  • WorkTime

    Compare remote & in-office productivity

    Explore
  • WorkTime

    Online meetings time monitoring

    Explore
  • WorkTime

    Overtime/false overtime monitoring

    Explore
  • WorkTime

    Webcam, microphone use

    Explore
  • WorkTime

    Job search monitoring

    Explore
  • WorkTime

    Distraction score

    Explore
WorkTime

Alerts

WorkTime offers alerts for late, idle, and unproductive employees

Alerts are shown in reports and can also be sent automatically via email.

WorkTime

Green employee monitoring

WorkTime Green employee monitoring maintains workplace health. Effective, socially responsible, safe technology to keep your business going!

WorkTime Green employee monitoring supports workplace health. Effective, socially responsible, safe and ethical technology to keep your business going!

HIPAA compatible

GDPR compatible

Green screen productivity report

WorkTime

Green screen productivity report

Safe & effective replacement of invasive screenshots

As you can see from this image, the screen is 50% productive. The greatest share of unproductive activities belongs to YouTube. You see the history, you track the progress. Easy, effective, safe!

Try now 14 days free

Try WorkTime 14 days free

WorkTime trial is all inclusive:
all features, unlimited employees.
No credit card required.

Basic

$6.99

/ employee / month billed monthly

Premium

$8.99

/ employee / month billed monthly

Enterprise

$10.99

/ employee / month billed monthly

Compare plans

Use WorkTime for

Success story

WorkTime
Industry

Banking

Employees

170

Instant increase in active time!

This UK bank managed to increase their remote employees' active time by 46% in just 3 days! WorkTime functions and its transparent approach made it smooth and effective.

Read more
+46%

Excellent boost!

WorkTime
WorkTime

start monitoring now!

Start free trial

Vb.net Code To | Retrieve Data From Sql Server

' Employee class definition Public Class Employee Public Property EmployeeID As Integer Public Property FirstName As String Public Property LastName As String Public Property Department As String Public Property Salary As Decimal Public ReadOnly Property FullName As String Get Return $"FirstName LastName" End Get End Property End Class

Return count End Function Always use parameters when filtering data.

Using connection As New SqlConnection(connectionString) Dim query As String = "SELECT EmployeeID, FirstName, LastName, Department, Salary FROM Employees" Dim command As New SqlCommand(query, connection) Try Await connection.OpenAsync() Dim reader As SqlDataReader = Await command.ExecuteReaderAsync() While Await reader.ReadAsync() Dim emp As New Employee() emp.EmployeeID = Convert.ToInt32(reader("EmployeeID")) emp.FirstName = reader("FirstName").ToString() emp.LastName = reader("LastName").ToString() emp.Department = reader("Department").ToString() emp.Salary = Convert.ToDecimal(reader("Salary")) employees.Add(emp) End While reader.Close() Catch ex As SqlException MessageBox.Show("SQL Error: " & ex.Message) End Try End Using vb.net code to retrieve data from sql server

Public Function GetEmployeesByDepartment(deptName As String) As DataTable Dim dataTable As New DataTable() Dim connectionString As String = "Server=localhost;Database=YourDatabase;Integrated Security=True;" Using connection As New SqlConnection(connectionString) Dim query As String = "SELECT EmployeeID, FirstName, LastName, Salary FROM Employees WHERE Department = @Department" Dim command As New SqlCommand(query, connection) ' Add parameter to prevent SQL injection command.Parameters.AddWithValue("@Department", deptName) Dim adapter As New SqlDataAdapter(command) Try adapter.Fill(dataTable) Catch ex As SqlException MessageBox.Show("Error: " & ex.Message) End Try End Using

Return employees End Function This approach loads all data into memory and works well for data binding. ' Employee class definition Public Class Employee Public

Return dataTable End Function For Windows Forms or WPF applications, use async methods to keep the UI responsive.

CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY IDENTITY(1,1), FirstName NVARCHAR(50), LastName NVARCHAR(50), Department NVARCHAR(50), Salary DECIMAL(10,2) ); SqlDataReader provides the fastest read performance for large result sets but is read-only and forward-only. CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY

' Database Helper Class Public Class EmployeeDB Private Shared ReadOnly connectionString As String = "Server=localhost;Database=YourDatabase;Integrated Security=True;"

More benefits with WorkTime!

By industry

News & recent posts

' Employee class definition Public Class Employee Public Property EmployeeID As Integer Public Property FirstName As String Public Property LastName As String Public Property Department As String Public Property Salary As Decimal Public ReadOnly Property FullName As String Get Return $"FirstName LastName" End Get End Property End Class

Return count End Function Always use parameters when filtering data.

Using connection As New SqlConnection(connectionString) Dim query As String = "SELECT EmployeeID, FirstName, LastName, Department, Salary FROM Employees" Dim command As New SqlCommand(query, connection) Try Await connection.OpenAsync() Dim reader As SqlDataReader = Await command.ExecuteReaderAsync() While Await reader.ReadAsync() Dim emp As New Employee() emp.EmployeeID = Convert.ToInt32(reader("EmployeeID")) emp.FirstName = reader("FirstName").ToString() emp.LastName = reader("LastName").ToString() emp.Department = reader("Department").ToString() emp.Salary = Convert.ToDecimal(reader("Salary")) employees.Add(emp) End While reader.Close() Catch ex As SqlException MessageBox.Show("SQL Error: " & ex.Message) End Try End Using

Public Function GetEmployeesByDepartment(deptName As String) As DataTable Dim dataTable As New DataTable() Dim connectionString As String = "Server=localhost;Database=YourDatabase;Integrated Security=True;" Using connection As New SqlConnection(connectionString) Dim query As String = "SELECT EmployeeID, FirstName, LastName, Salary FROM Employees WHERE Department = @Department" Dim command As New SqlCommand(query, connection) ' Add parameter to prevent SQL injection command.Parameters.AddWithValue("@Department", deptName) Dim adapter As New SqlDataAdapter(command) Try adapter.Fill(dataTable) Catch ex As SqlException MessageBox.Show("Error: " & ex.Message) End Try End Using

Return employees End Function This approach loads all data into memory and works well for data binding.

Return dataTable End Function For Windows Forms or WPF applications, use async methods to keep the UI responsive.

CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY IDENTITY(1,1), FirstName NVARCHAR(50), LastName NVARCHAR(50), Department NVARCHAR(50), Salary DECIMAL(10,2) ); SqlDataReader provides the fastest read performance for large result sets but is read-only and forward-only.

' Database Helper Class Public Class EmployeeDB Private Shared ReadOnly connectionString As String = "Server=localhost;Database=YourDatabase;Integrated Security=True;"