Click here to Skip to main content
15,917,862 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Secure Code to Reflector Pin
Anubhava Dimri18-Nov-09 23:13
Anubhava Dimri18-Nov-09 23:13 
GeneralRe: Secure Code to Reflector Pin
Dave Kreskowiak19-Nov-09 2:08
mveDave Kreskowiak19-Nov-09 2:08 
GeneralRe: Secure Code to Reflector Pin
o m n i19-Nov-09 2:37
o m n i19-Nov-09 2:37 
GeneralRe: Secure Code to Reflector Pin
Dave Kreskowiak19-Nov-09 3:34
mveDave Kreskowiak19-Nov-09 3:34 
GeneralRe: Secure Code to Reflector Pin
Anubhava Dimri19-Nov-09 17:39
Anubhava Dimri19-Nov-09 17:39 
GeneralRe: Secure Code to Reflector Pin
Anubhava Dimri19-Nov-09 17:09
Anubhava Dimri19-Nov-09 17:09 
Questionlower case to upper case but looks like something else is going on Pin
VB 12318-Nov-09 16:49
VB 12318-Nov-09 16:49 
AnswerRe: lower case to upper case but looks like something else is going on Pin
Dave Kreskowiak18-Nov-09 17:26
mveDave Kreskowiak18-Nov-09 17:26 
Please tell me you're not using the old ADODB objects you used in VB6? Scrap it and rewrite using ADO.NET instead.


VB 123 wrote:
If .resoi.Fields.Item("rtype").Value = "M" Then
x = .sio.Fields.Item("rpop").Value * .itemsi.Fields.Item("ireptime").Value * wage * .iri.Fields.Item("trqtyrqrd").Value
.siro.Fields.Item("alaborcost").Value = .siro.Fields.Item("alaborcost").Value + x
.sro.Fields.Item("arescost").Value = .sro.Fields.Item("arescost").Value + x
.siro.Fields.Item("alaborhrs").Value = .siro.Fields.Item("alaborhrs").Value + .sio.Fields.Item("rpop").Value * .itemsi.Fields.Item("ireptime").Value * .iri.Fields.Item("trqtyrqrd").Value
End If


I wouldn't call this "error-free code". It may run as expected, but it makes a LOT of assumptions about the data and relies heavily on VBs implicit conversions. That is not good practice. I'd start by opening up the project properties and turning on Option Strict. You'll then have to rewrite the code to explicitly do conversions to known data types, but only after checking the fields for convertible data. For example, you can't convert a DbNull to an Integer.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: lower case to upper case but looks like.... SOLVED Pin
VB 12319-Nov-09 3:33
VB 12319-Nov-09 3:33 
GeneralRe: lower case to upper case but looks like.... SOLVED Pin
Dave Kreskowiak19-Nov-09 3:38
mveDave Kreskowiak19-Nov-09 3:38 
GeneralRe: lower case to upper case but looks like.... SOLVED Pin
VB 12320-Nov-09 12:37
VB 12320-Nov-09 12:37 
GeneralUnexpected characters in print ouptut - VB2008 Pin
rbc102518-Nov-09 10:48
rbc102518-Nov-09 10:48 
GeneralRe: Unexpected characters in print ouptut - VB2008 Pin
DaveAuld18-Nov-09 11:06
professionalDaveAuld18-Nov-09 11:06 
GeneralRe: Unexpected characters in print ouptut - VB2008 Pin
rbc102518-Nov-09 17:06
rbc102518-Nov-09 17:06 
QuestionProblem in VB while trying to execute SQL Code Pin
nhsal6918-Nov-09 3:37
nhsal6918-Nov-09 3:37 
AnswerRe: Problem in VB while trying to execute SQL Code Pin
Eduard Keilholz18-Nov-09 4:08
Eduard Keilholz18-Nov-09 4:08 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
nhsal6918-Nov-09 4:17
nhsal6918-Nov-09 4:17 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
Luc Pattyn18-Nov-09 5:02
sitebuilderLuc Pattyn18-Nov-09 5:02 
AnswerRe: Problem in VB while trying to execute SQL Code Pin
The Man from U.N.C.L.E.18-Nov-09 8:01
The Man from U.N.C.L.E.18-Nov-09 8:01 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
nhsal6918-Nov-09 21:13
nhsal6918-Nov-09 21:13 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
Ashfield18-Nov-09 21:30
Ashfield18-Nov-09 21:30 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
nhsal6918-Nov-09 23:08
nhsal6918-Nov-09 23:08 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
Ashfield19-Nov-09 1:25
Ashfield19-Nov-09 1:25 
GeneralRe: Problem in VB while trying to execute SQL Code Pin
The Man from U.N.C.L.E.18-Nov-09 22:44
The Man from U.N.C.L.E.18-Nov-09 22:44 
QuestionConsole application Pin
offroaderdan17-Nov-09 23:35
offroaderdan17-Nov-09 23:35 

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.