johansenng
Newcomer
- Joined
- Jun 23, 2003
- Messages
- 12
Hi, i am new to vb.net,, so pardon my ignorance..
I have query a datetime type (containing a Time value) using SQL select into a dataset and then to a datagrid. However when the program is exec, the column gives me the date value (which i did not enter.. should be the default date value), instead of the time value. How do i make the datagrid show only the Time value?? Thanks..
da.SelectCommand.CommandText = "SELECT [Today].Nric, [Personnel].Name," & _
"[Today].TimeIn, [Today].TimeOut, [Personnel].MobileNo, [Personnel].Genre " & _
"FROM [Today] inner join [Personnel] on" & _
"[Today].Nric=[Personnel].Nric"
da.SelectCommand.CommandType = CommandType.Text
Try
da.SelectCommand.ExecuteNonQuery()
Catch err As OleDbException
MessageBox.Show(err.ToString)
End Try
ds.Clear()
da.Fill(ds, "today")
objConnection.Close()
dg.DataSource = ds
dg.DataMember = "today"
I have query a datetime type (containing a Time value) using SQL select into a dataset and then to a datagrid. However when the program is exec, the column gives me the date value (which i did not enter.. should be the default date value), instead of the time value. How do i make the datagrid show only the Time value?? Thanks..
da.SelectCommand.CommandText = "SELECT [Today].Nric, [Personnel].Name," & _
"[Today].TimeIn, [Today].TimeOut, [Personnel].MobileNo, [Personnel].Genre " & _
"FROM [Today] inner join [Personnel] on" & _
"[Today].Nric=[Personnel].Nric"
da.SelectCommand.CommandType = CommandType.Text
Try
da.SelectCommand.ExecuteNonQuery()
Catch err As OleDbException
MessageBox.Show(err.ToString)
End Try
ds.Clear()
da.Fill(ds, "today")
objConnection.Close()
dg.DataSource = ds
dg.DataMember = "today"