VB.Net - Referencing DataTable Fields in Code and Query Strings
Posted on 2013-01-30
Good Day Experts!
I am looking for some direction in how to reference data in a DataTable.
For Each sqlRSGetLineItems In sqlRStbl.Rows
When I just want to condition on a field, do I just need? --> sqlRSGetLineItems("SCAC")
How do I know if I need .Value or .ToString at the end?
When I just want to use a value from a field, why not just? --> '" & sqlRSGetLineItems("SCAC") & "'
What are the rules with using .Value or .ToString at the end?
What about needing to use CDec? --> '" & CDec(sqlRSGetLineItems("SCAC").ToString) & "'
I mean the data in the DataTable I am retrieving is decimal so why do I have to do the CDec?
Hopefully you can lend some insight and help me understand what needs to be used when and why.