Click here to Skip to main content
15,918,267 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Free Visual Basic.NET Videos Pin
DickInYaMum6-Jan-06 0:19
DickInYaMum6-Jan-06 0:19 
GeneralRe: Free Visual Basic.NET Videos Pin
Jonathan [Darka]6-Jan-06 1:56
professionalJonathan [Darka]6-Jan-06 1:56 
GeneralRe: Free Visual Basic.NET Videos Pin
xlr<span style="font-size110%color#990000font-we6-Jan-06 5:34
xlr<span style="font-size110%color#990000font-we6-Jan-06 5:34 
AnswerRe: Free Visual Basic.NET Videos Pin
militiaware5-Jan-06 13:01
militiaware5-Jan-06 13:01 
QuestionChanging Appearance of controls Pin
engsrini5-Jan-06 0:23
engsrini5-Jan-06 0:23 
AnswerRe: Changing Appearance of controls Pin
Roy Heil5-Jan-06 3:41
professionalRoy Heil5-Jan-06 3:41 
Questionpasting data from clipboard in excel using vb.net Pin
uktrips0074-Jan-06 23:25
uktrips0074-Jan-06 23:25 
QuestionTime Format in a DataGrid Column Pin
mygeek4-Jan-06 22:58
mygeek4-Jan-06 22:58 
Hello.

I am attempting to display the contents of a Date/Time column from an Access database table in my DataGrid Control in VB.NET

The DataGrid control (ReportGrid) is bound to a DataSet, which is filled using a DataAdapter with the data stored in a recordset (snippets are given below)

Public reportDA As New OleDb.OleDbDataAdapter
Public reportDS As New DataSet
Public GridReport As New ADODB.Recordset

GridReport.Open(SQLtxt, DBConnection, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly)

reportDA.Fill(reportDS, GridReport, "Report")

ReportGrid.SetDataBinding(reportDS, "Report")

The "Report" table held within the DataSet contains several columns. I am able to display the 'Date' column within the DataGrid but the 'Time' column displays the information in a Date Format:

Original Database table displays: 10:16:51
DataGrid Control table displays: 30/12/1899 (For any time)

I have tried to directly copy the contents of the Access table using the coding below but with no success:

GridReport.MoveFirst()
For i = 0 To GridReport.RecordCount - 1
reportDS.Tables("Report").Rows(i).Item("Time") = GridReport.Fields("Time").Value
GridReport.MoveNext()
Next

Any help would be most appreciated.


-- modified at 8:21 Thursday 5th January, 2006
AnswerRe: Time Format in a DataGrid Column Pin
Dave Kreskowiak5-Jan-06 3:27
mveDave Kreskowiak5-Jan-06 3:27 
GeneralRe: Time Format in a DataGrid Column Pin
mygeek5-Jan-06 3:43
mygeek5-Jan-06 3:43 
QuestionConvert the SID of an user to String Pin
fredy6664-Jan-06 22:28
fredy6664-Jan-06 22:28 
AnswerRe: Convert the SID of an user to String Pin
Dave Kreskowiak5-Jan-06 3:22
mveDave Kreskowiak5-Jan-06 3:22 
GeneralRe: Convert the SID of an user to String Pin
fredy6665-Jan-06 4:47
fredy6665-Jan-06 4:47 
QuestionList of Hardwares/Softwares Pin
anujvtt4-Jan-06 22:09
anujvtt4-Jan-06 22:09 
AnswerRe: List of Hardwares/Softwares Pin
Dave Kreskowiak5-Jan-06 3:20
mveDave Kreskowiak5-Jan-06 3:20 
Questionms flaxgrid control.... Pin
Kamalatharsan4-Jan-06 20:06
Kamalatharsan4-Jan-06 20:06 
AnswerRe: ms flaxgrid control.... Pin
Dave Kreskowiak5-Jan-06 3:18
mveDave Kreskowiak5-Jan-06 3:18 
GeneralRe: ms flaxgrid control.... Pin
Kamalatharsan6-Jan-06 18:45
Kamalatharsan6-Jan-06 18:45 
AnswerRe: ms flaxgrid control.... Pin
Member 21312795-Jan-06 3:55
Member 21312795-Jan-06 3:55 
GeneralRe: ms flaxgrid control.... Pin
Kamalatharsan6-Jan-06 1:41
Kamalatharsan6-Jan-06 1:41 
QuestionVariable Declaration Pin
jcrussell4-Jan-06 17:44
jcrussell4-Jan-06 17:44 
AnswerRe: Variable Declaration Pin
Christian Graus4-Jan-06 17:56
protectorChristian Graus4-Jan-06 17:56 
GeneralRe: Variable Declaration Pin
jcrussell4-Jan-06 20:52
jcrussell4-Jan-06 20:52 
GeneralRe: Variable Declaration Pin
Christian Graus5-Jan-06 10:05
protectorChristian Graus5-Jan-06 10:05 
QuestionGDI+ Exception Pin
militiaware4-Jan-06 15:55
militiaware4-Jan-06 15:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.