XSD data set with Oracle database
I'm having a major issue with an XSD dataset mapping thingy that I'm using within my current project. We are using XSDs for some data abstraction (it's quicker and debatably more maintainable that using Parameterised SQL or开发者_如何转开发 a StoredProc), and on my machine (running in the VS development environment) thy're working fine.
However, on the Pre-production server we use for our testing, the XSDs are not working correctly: some method calls will fail with the following error:
System.ArgumentException: Value does not fall within the expected range.
at Oracle.DataAccess.Client.OracleParameter.set_DbType(DbType value)
Has anyone ever encountered this issue before? The methods being called are simple select statements using 1-3 parameters, and as I said before they work fine on my machine.
We came across this issue too after converting our Data Sets (XSD's) from using System.Data.OracleClient to Oracle.DataAccess.Client.
The issue was that the Data Set designer was still using "Number" as the data type for the ProviderType. Oracle does not support the "Number" data type. We had to change the ProviderType in each of our Data Sets for each Table Adapter and each collection of Parameters for every query in the Table Adapter. We used "Decimal" for the ProviderType, and it seems to work fine. Don't forget to check the auto-generated "Select", "Update", and "Delete" queries too.
Hopefully this will help someone.
精彩评论