I'm having trouble formatting the datetime field in a gatagrid.
I am able to format the date using:
<asp:BoundColumn DataField="MyDateColumn" DataFormatString="{0:d}" ... />
But Since I'm using two tables, I'm creating the datagrid manually instead of using "GridView" from the Toolbox.
My Code:
================
Dim comm2 As SqlDataAdapter = New SqlDataAdapter("select T.taskID as 'ID', T.taskName as 'Task', T.taskDescription as 'Description', S.staffName as 'AssignedTo', T.assignedOn as 'AssignedOn', T.deadline as 'Deadline', T.priority as 'Priority' from temp_staff S, tasks T where S.staffRecNo = T.assignedTo and T.assignedBy = '" & staffRecNo & "' and T.deadline > '" & finalDate1 & "' and T.deadline < '" & finalDate2 & "' ", conn2)
Dim ds2 As DataSet = New DataSet
comm2.Fill(ds2, "test")
dg1.Visible = True
dg1.DataSource = ds2.Tables("test")
dg1.DataBind()
=================
Please help