Click here to Skip to main content
16,005,120 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Update database in designer Pin
cstrader23216-Aug-06 6:34
cstrader23216-Aug-06 6:34 
QuestionDateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 5:11
TAtechsupport16-Aug-06 5:11 
AnswerRe: DateTime datatype returns Date only Pin
Stephen McGuire16-Aug-06 5:40
Stephen McGuire16-Aug-06 5:40 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 6:57
TAtechsupport16-Aug-06 6:57 
AnswerRe: DateTime datatype returns Date only Pin
Guffa16-Aug-06 8:38
Guffa16-Aug-06 8:38 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 8:56
TAtechsupport16-Aug-06 8:56 
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire16-Aug-06 9:52
Stephen McGuire16-Aug-06 9:52 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 10:25
TAtechsupport16-Aug-06 10:25 
I am using a DataGrid. I don't doubt that the time is there, because it is being returned by the SELECT query, but what am I missing that will display the data as "6/19/2006 12:57:58 PM". If you can't tell, I am new to VB, so I am sure that I am neglecting to do something very simplistic. Maybe it would help to explain what I am trying to accomplish. I support a Time & Attendance application. The table that I am attempting to query contains punch data (time in & out). I am trying to build an interface to delete selected transactions. The 3 elements in the SELECT query are all set as primary keys.

The following code is supposed to fill my DataSet, which it does.

Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
OleDbDataAdapter1.Fill(DataSet11, "Time_Post_Work")
End Sub

If I then delete a transaction from the DataGrid and click on my Save button it should update this back to the original database, but instead what I get is a 'System.Data.DBConcurrencyException' error and no records are updated.

This is the DELETE query VB generated:
'DELETE FROM TIME_POST_WORK WHERE (Clock_Nbr = ?) AND (Seq_No = ?) AND (Punch = ?)'

I maybe wrong, but I think it is not allowing the deletion because the Date that appears in the DataSet does not match the DateTime that appears in the database. If I modify the DELETE query to read as follows:
'DELETE FROM TIME_POST_WORK WHERE (Clock_Nbr = ?) AND (Seq_No = ?)'

the transaction is removed from the database. But since this is Date and Time specific data, I need to be able to see that I am removing a transaction at 12:55 PM on 6/19/2006 as opposed to any old transaction on 6/19/2006.

Sorry for so many words. Is there some other information that I could provide that might help?

Thanks for you help so far.
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire16-Aug-06 10:37
Stephen McGuire16-Aug-06 10:37 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 10:42
TAtechsupport16-Aug-06 10:42 
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire16-Aug-06 10:50
Stephen McGuire16-Aug-06 10:50 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 11:23
TAtechsupport16-Aug-06 11:23 
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire16-Aug-06 12:08
Stephen McGuire16-Aug-06 12:08 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport16-Aug-06 13:23
TAtechsupport16-Aug-06 13:23 
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire17-Aug-06 0:20
Stephen McGuire17-Aug-06 0:20 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport17-Aug-06 3:13
TAtechsupport17-Aug-06 3:13 
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire17-Aug-06 6:53
Stephen McGuire17-Aug-06 6:53 
GeneralRe: DateTime datatype returns Date only Pin
TAtechsupport17-Aug-06 11:15
TAtechsupport17-Aug-06 11:15 
GeneralRe: DateTime datatype returns Date only Pin
Stephen McGuire17-Aug-06 11:26
Stephen McGuire17-Aug-06 11:26 
GeneralRe: DateTime datatype returns Date only Pin
S Pandian16-Aug-06 22:55
S Pandian16-Aug-06 22:55 
QuestionExchange 6.5 Recipients List Pin
Tim Carmichael16-Aug-06 4:14
Tim Carmichael16-Aug-06 4:14 
QuestionHR Software Code Pin
Mushfiq Alam16-Aug-06 4:07
Mushfiq Alam16-Aug-06 4:07 
AnswerRe: HR Software Code Pin
Michael P Butler16-Aug-06 4:17
Michael P Butler16-Aug-06 4:17 
QuestionWordpad & spaces in the RTF filename [modified] Pin
John Waclawski16-Aug-06 3:38
John Waclawski16-Aug-06 3:38 
AnswerRe: Wordpad & spaces in the RTF filename Pin
Stephen McGuire16-Aug-06 6:13
Stephen McGuire16-Aug-06 6:13 

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.