Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: vb.net 2010 db error message Pin
dcof16-Mar-16 7:06
dcof16-Mar-16 7:06 
QuestionHow to separate the hours and min.? because the hours is only added to min.? Pin
Real Corks15-Mar-16 5:46
Real Corks15-Mar-16 5:46 
QuestionRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard MacCutchan15-Mar-16 6:17
mveRichard MacCutchan15-Mar-16 6:17 
AnswerRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Real Corks15-Mar-16 9:18
Real Corks15-Mar-16 9:18 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Dave Kreskowiak15-Mar-16 9:34
mveDave Kreskowiak15-Mar-16 9:34 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Real Corks15-Mar-16 12:36
Real Corks15-Mar-16 12:36 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Eddy Vluggen15-Mar-16 13:45
professionalEddy Vluggen15-Mar-16 13:45 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Dave Kreskowiak16-Mar-16 4:38
mveDave Kreskowiak16-Mar-16 4:38 
Ummm.... you're getting the formatted date/times from two grid cells, converting them to strings, them parsing those strings back into what I am assuming are two DateTime fields, dto and dfrom, doing some math on them and then... yeah, this is a freakin' mess.

If you're doing this properly, you don't need all this stuff. All you need is the Values of those Cells, not the formatted values. But, then again, I'm assuming your database is storing dates and times as Date/Time and not strings. You BETTER be storing these things as the correct types otherwise you're really making your life much harder than it needs to be.
dto = row.Cells(3).Value
dFrom = row.Cells(4).Value

result = dto - dfrom

Console.WriteLine("{0}", result))

A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard MacCutchan16-Mar-16 5:35
mveRichard MacCutchan16-Mar-16 5:35 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Real Corks17-Mar-16 1:24
Real Corks17-Mar-16 1:24 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard Deeming17-Mar-16 2:01
mveRichard Deeming17-Mar-16 2:01 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard MacCutchan15-Mar-16 10:35
mveRichard MacCutchan15-Mar-16 10:35 
AnswerRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Eddy Vluggen15-Mar-16 10:10
professionalEddy Vluggen15-Mar-16 10:10 
JokeRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Sascha Lefèvre15-Mar-16 10:44
professionalSascha Lefèvre15-Mar-16 10:44 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Eddy Vluggen15-Mar-16 11:02
professionalEddy Vluggen15-Mar-16 11:02 
RantInsert data in multiple table and having froreign key... Pin
Member 1238897313-Mar-16 20:10
Member 1238897313-Mar-16 20:10 
GeneralRe: Insert data in multiple table and having froreign key... Pin
Mycroft Holmes13-Mar-16 21:25
professionalMycroft Holmes13-Mar-16 21:25 
QuestionExperiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy4-Mar-16 3:45
Jon_Boy4-Mar-16 3:45 
AnswerRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen4-Mar-16 12:04
professionalEddy Vluggen4-Mar-16 12:04 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy4-Mar-16 14:39
Jon_Boy4-Mar-16 14:39 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen4-Mar-16 23:37
professionalEddy Vluggen4-Mar-16 23:37 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy9-Mar-16 10:45
Jon_Boy9-Mar-16 10:45 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen9-Mar-16 10:58
professionalEddy Vluggen9-Mar-16 10:58 
QuestionCan someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Real Corks2-Mar-16 12:13
Real Corks2-Mar-16 12:13 
AnswerRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan2-Mar-16 21:12
mveRichard MacCutchan2-Mar-16 21:12 

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.