I was going to say: "The source table in the database contains no rows. Go check it with an SQL query tool"
point of note here.. if you were working with typed datasets then your IsNull methods would be made for you.. like this:
Dim AccessDataSet as New MyDataSet.AccessDataTable
DirectCast(AccessDataSet.tbl_HCI_Missing_Lot_Count.Rows(0), MyDataSet.AccessDataTableRow).IsintLostLotNumNull()
Alternatively, this:
DirectCast(AccessDataSet.tbl_HCI_Missing_Lot_Count.Rows(0), MyDataSet.AccessDataTableRow).intLostLotNum
Returns you a Nullable(Of Long) which you can call GetValueOrDefault() on:
lngDummy = DirectCast(AccessDataSet.tbl_HCI_Missing_Lot_Count.Rows(0), MyDataSet.AccessDataTableRow).intLostLotNum.GetValueOrDefault(0)
mmmm.. strong typing is NICE. most my vb6-only friends balk at it, but im trying to upgrade them to the 20th century..
Side point.. one of them was calling the oracle function TO_CHAR(myNumberStoredAsString, '0.00') the other day:
"matt, why doesnt this work?"
"what?"
"this oracle function says it doesnt know which overload to call"
"that means that it could reasonably call more than one function called to_char and it doesnt know which one to call"
"why not?"
"because its not a mind reader? which one do you want it to call"
"i'm trying to format a number"
"are you passing a number in?"
"yes"
"a number data type?"
"no, it's a string"
"that holds a number?"
"yes"
"so you want oracle to inspect the string, see that it holds only numerical characters, and call the number one for you?"
"yes"
"how can you reasonably expect it to do that? convert it to a number first!"
"why should I have to? why cant oracle do as i say?"
"it doesnt know which one to call.. you can tell it which to call based on the name of the parameter but you shouldnt have to have oracle do the number conversion implicitly based on its guess"
"why not?"
"because a computer cannot think any more than a submarine can swim. convert that string to a number if youre so sure it contains only numbers"
"how?"
"use to_number"
"instead of to_char?"
"no, aswell as tochar.. wrap the argument to it is converted to a number before a char"
"why?"
"because youre trying to format a number, pass in a number"
"why cant oracle do that for me?"
"because it cant be sure that string holds a number"
"why cant it look?"
"because it has to compile a route and the route might change if one day there isnt a number in there"
"so i have to go to all the hassle of writing to_number to convert my string to a number, only to convert it back to a string?"
"yes. it's what oracle would do implicitly anyway if it was sure of what to do.. it isnt, so do it explicitly, and shut your moaning"
"thats retarded"
oh, we have some amusing debates, i tell you. i'll drag him into the typed world yet, kicking and screaming if needs be (i'll do the kicking
)