Click here to Skip to main content
15,906,816 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Calculate networkdays in vb.net, can someone help me? Pin
Sascha Lefèvre27-Mar-16 12:29
professionalSascha Lefèvre27-Mar-16 12:29 
AnswerRe: Calculate networkdays in vb.net, can someone help me? Pin
CHill6027-Mar-16 12:44
mveCHill6027-Mar-16 12:44 
Questionsum a field in database, can someone help me? Pin
Real Corks27-Mar-16 4:21
Real Corks27-Mar-16 4:21 
AnswerRe: sum a field in database, can someone help me? Pin
Sascha Lefèvre27-Mar-16 4:58
professionalSascha Lefèvre27-Mar-16 4:58 
GeneralRe: sum a field in database, can someone help me? Pin
Real Corks27-Mar-16 9:05
Real Corks27-Mar-16 9:05 
GeneralRe: sum a field in database, can someone help me? Pin
Sascha Lefèvre27-Mar-16 9:42
professionalSascha Lefèvre27-Mar-16 9:42 
GeneralRe: sum a field in database, can someone help me? Pin
Real Corks27-Mar-16 9:47
Real Corks27-Mar-16 9:47 
GeneralRe: sum a field in database, can someone help me? Pin
Sascha Lefèvre27-Mar-16 10:12
professionalSascha Lefèvre27-Mar-16 10:12 
Apparently the result of the query is null (DBNull) because there were no records matching the criteria. So your code attempted to assign DBNull to an Integer, which doesn't work. Try this:
VB
Dim val As Object = cmd.ExecuteScalar("SumTotalLate")
If TypeOf val Is DBNull Then
	TextLateDeduct.Text = "0"
Else
	TextLateDeduct.Text = val.ToString()
End If

It will most certainly result in "0" being displayed, which, as you say, is not the result that you expect. But you also reversed the SQL command back to your first version, which, I think, is not correct. Did you try it with my modified SQL command?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: sum a field in database, can someone help me? Pin
Real Corks27-Mar-16 11:29
Real Corks27-Mar-16 11:29 
Questioncan someone help me to fix this? because i cannot make another xml file only the employee information Pin
Real Corks17-Mar-16 17:47
Real Corks17-Mar-16 17:47 
AnswerRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Patrice T17-Mar-16 20:49
mvePatrice T17-Mar-16 20:49 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Real Corks20-Mar-16 21:43
Real Corks20-Mar-16 21:43 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
CHill6020-Mar-16 22:41
mveCHill6020-Mar-16 22:41 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Real Corks27-Mar-16 4:18
Real Corks27-Mar-16 4:18 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
CHill6027-Mar-16 5:29
mveCHill6027-Mar-16 5:29 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Richard MacCutchan21-Mar-16 1:10
mveRichard MacCutchan21-Mar-16 1:10 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Dave Kreskowiak21-Mar-16 2:47
mveDave Kreskowiak21-Mar-16 2:47 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Richard MacCutchan21-Mar-16 2:55
mveRichard MacCutchan21-Mar-16 2:55 
Questionvb.net 2010 has sql error Pin
dcof16-Mar-16 12:28
dcof16-Mar-16 12:28 
AnswerRe: vb.net 2010 has sql error Pin
Mycroft Holmes16-Mar-16 23:08
professionalMycroft Holmes16-Mar-16 23:08 
AnswerRe: vb.net 2010 has sql error Pin
dcof17-Mar-16 8:43
dcof17-Mar-16 8:43 
Questionvb Pin
Member 1239502015-Mar-16 18:23
Member 1239502015-Mar-16 18:23 
AnswerRe: vb Pin
Mycroft Holmes15-Mar-16 20:04
professionalMycroft Holmes15-Mar-16 20:04 
AnswerRe: vb Pin
Patrice T19-Mar-16 12:09
mvePatrice T19-Mar-16 12:09 
QuestionNeed help on making a advanced internet based application? VB.NET Pin
Member 1237915715-Mar-16 18:07
Member 1237915715-Mar-16 18:07 

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.