Anyone else using the Oracle Data Provider (Oracle.DataAccess.Client) instead of System.Data.OracleClient? GetInt32 doesn't work for ints because Oracle always returns numbers at decimals. I can change the calls to (int)dr.GetDecimal but was wondering if anyone had a better workaround.
Thanks,
Mike
You just subclass SafeDataReader and override the method you want to modify and use your own implementation. Then in your code instead of using "New SafeDataReader" you use "New MySafeDataReader" (or whatever you decide to call it.)
Here is how I handled Booleans for Oracle:
Imports
CslaNamespace
BO 'My Base class for modifications to Csla.Data.SafeDataReader<Serializable()> _
#Region
" Class Variable Declarations "#Region
" Properties and Methods " Public Overrides Function GetBoolean(ByVal i As Integer) As Boolean#End
RegionJoe
Joe,
Just out of curiosity what are you doing with decimal vs. int32? My earlier version of my application used int32 all over the place for my ID keys and I did the (int) conversion on reading them in. Now with CSLA and using CodeSmith all my keys are coming back as decimal.
Would you suggest I re-code the templates to use int32 in lieu of decimal except when directly doing Oracle data access?
Thanks
jack
I no longer have to support Oracle. Plus I never used the Oracle provider - I used the Microsoft version. But now you should be able to make a decision as to which way to go and then use the code sample to get you there.
Joe
Copyright (c) Marimer LLC