The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by charder]

Thanks for your article on how to implement the Bank class using Jet.
In our article you state:

That should be the end of it, but it's not. During testing I was surprised by
some invalid cast errors generated by lines such as:



takenIn = (int) dr[0];



A quick and dirty change fixed the problem:



takenIn = Int32.Parse(dr[0].ToString());


There is a more elegant way to do this using OLEDB data types, but we won't go
into it here.




I would like to know what the more elegant way is.

Thanks
Cara Harder
import-bot (20211) [Avatar] Offline
#2
Re: OLEDB Data Types
[Originally posted by fgrimes]

Hi Cara,
Schedule permitting, I hope to cover this in a further article soon.
Fergal