0

I have a datagridview that tracks when employees clock in and out. I used the datetime data type in sql but I dont want the year to display. How would i go about doing this? Do i have to modify my select statement, or can I do it with vb code?


Thanks in advance

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by lolwtf
Featured Replies
  • 1
    __avd 1,826   7 Years Ago

    Here is sample: [CODE=VB.NET] Dim col1 As New DataGridViewTextBoxColumn col1.DefaultCellStyle.Format = "t" 'Time format col1.DataPropertyName = "ColumnName" DataGridView1.Columns.Add(col1) DataGridView1.DataSource = dt 'Instance of DataTable [/CODE] Read More

0

Thats sort of what im looking for. I have this so far:
DGVTime.Columns("InOuTime").

InOutTime is my variable in sql but im stuck at this part.

0

try using these example textbox1.text = (cell of the grid).tostring("hh:mm:ss") just give it a try

1

Here is sample:

Dim col1 As New DataGridViewTextBoxColumn
        col1.DefaultCellStyle.Format = "t" 'Time format
        col1.DataPropertyName = "ColumnName"

        DataGridView1.Columns.Add(col1)
        DataGridView1.DataSource = dt  'Instance of DataTable
Comments
Always helpfull!
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.