Migration Wizard problems
Migration Wizard problems
Tried to migrate the project from Microsoft.Data.OracleClient to Devart dotConnect. I used the Migration Wizard. I was faced with the following problem - all Russian characters in the *.cs files were replaced by question characters, like this:
#region ��������� ����� ������������ �� ����������
In addition, Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.
#region ��������� ����� ������������ �� ����������
In addition, Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We could not reproduce the issue. Please provide the following information:
1. Visual Studio version.
2. Project type (Console Ppplication, Win Forms, etc.).
3. Target .Net Framework of your project.
4. The example of files with region containing russian characters before migration and after migration.
5. If possible, archive your project and upload it to our ftp server (ftp://ftp.devart.com, credentials: anonymous/anonymous ) or to any file exchange server so that we could download it from there. And send us the password to the archive.
https://www.devart.com/dotconnect/oracl ... pping.html
https://www.devart.com/dotconnect/oracl ... pings.html
1. Visual Studio version.
2. Project type (Console Ppplication, Win Forms, etc.).
3. Target .Net Framework of your project.
4. The example of files with region containing russian characters before migration and after migration.
5. If possible, archive your project and upload it to our ftp server (ftp://ftp.devart.com, credentials: anonymous/anonymous ) or to any file exchange server so that we could download it from there. And send us the password to the archive.
dotConnect for Oracle maps Oracle Number to different .NET types, depending on the precision and scale of the Number type in Oracle. It can be configured with NumberMappings. For more information about default number mapping, please refer toSLavaLL2 wrote:In addition, Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.
https://www.devart.com/dotconnect/oracl ... pping.html
https://www.devart.com/dotconnect/oracl ... pings.html
Re: Migration Wizard problems
The problem with files in win-1251 encoding.
UTF-8 files migtrated correctly
Examples can be downloaded here https://yadi.sk/d/tj5pe_FqsuAp8Q
1. Visual Studio 2012
2. Example - Console application, Real projects - WinForms, WinServices, Libraries...
3. .NetFramework 4.0 - 4.6.2
ID number(12) i got as double.
Where else expect different behavior from the System.Data.OracleClient (Microsoft provider)?
UTF-8 files migtrated correctly
Examples can be downloaded here https://yadi.sk/d/tj5pe_FqsuAp8Q
1. Visual Studio 2012
2. Example - Console application, Real projects - WinForms, WinServices, Libraries...
3. .NetFramework 4.0 - 4.6.2
I understand, by this behavior was unexpected.dotConnect for Oracle maps Oracle Number to different .NET types, depending on the precision and scale of the Number type in Oracle. It can be configured with NumberMappings. For more information about default number mapping, please refer to
https://www.devart.com/dotconnect/oracl ... pping.html
https://www.devart.com/dotconnect/oracl ... pings.html
ID number(12) i got as double.
Where else expect different behavior from the System.Data.OracleClient (Microsoft provider)?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.SLavaLL2 wrote:Examples can be downloaded here https://yadi.sk/d/tj5pe_FqsuAp8Q
You only need to change your connection string by adding the following parameter to it:SLavaLL2 wrote:Oracle Number type is mapped to System.Double type, although in Microsoft.Data.OracleClient it is mapped to the System.Decimal type.
"Number Mappings=(Integer,11,18,System.Decimal);" - will map Number values, having precision from 11 to 18, to System.Decimal
For more information, please refer to
https://www.devart.com/dotconnect/oracl ... tring.html
https://www.devart.com/dotconnect/oracl ... rType.html
https://www.devart.com/dotconnect/oracl ... pings.html
You need to add the following line after migration:SLavaLL2 wrote:Where else expect different behavior from the System.Data.OracleClient (Microsoft provider)?
Code: Select all
OracleUtils.OracleClientCompatible=true
For more information, please refer to https://www.devart.com/dotconnect/oracl ... ation.html
Re: Migration Wizard problems
I have some places with code like this:
This code works correctly with Microsoft provider.
And with Devart provider rdr is null, because param.Value is Devart.Data.Oracle.OracleCurstor type.
Code: Select all
OracleParameter curs_param = new OracleParameter("P#CURSOR", OracleDbType.Cursor)
{ Direction = ParameterDirection.Output };
cmd.Parameters.Add(curs_param);
cmd.ExecuteNonQuery();
OracleDataReader rdr = curs_param.Value as OracleDataReader;
And with Devart provider rdr is null, because param.Value is Devart.Data.Oracle.OracleCurstor type.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
Replace the line:
with the following one:
For more information, please refer to https://www.devart.com/dotconnect/oracl ... ursor.html
Code: Select all
OracleDataReader rdr = curs_param.Value as OracleDataReader;
Code: Select all
OracleDataReader rdr = ((OracleCursor)curs_param.Value).GetDataReader();
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We have fixed the bug with corrupting not Latin-1 characters by Migration Wizard for files with non-unicode encoding. We will post here when the corresponding build of dotConnect for Oracle is available for download.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
New build of dotConnect for Oracle 9.6.725 is available for download.
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38518
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38518
Re: Migration Wizard problems
Another problem:
I have a stored procedure
I called it from c#
I got an error "ORA-01756: quoted string not properly terminated"
In SQL monitor I saw
Version of code without time works correctly.
I have a stored procedure
Code: Select all
create or replace procedure user.aaa(p#date_start date)is
begin
null;
end;
Code: Select all
string server = "SERVER";
string user_name = "USER";
string password = "PASSWORD";
string connStr = "Persist Security Info=False;max pool size=1100;connection lifetime=3600;Number Mappings=((Integer,10,18,System.Int64),(Number,1,38,System.Decimal));User ID=" + user_name + ";Data Source=" + server + ";Password=" + password;
OracleConnection conn = new OracleConnection(connStr);
conn.Open();
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "USER.AAA(TO_DATE('20061222 17:27:08', 'yyyymmdd HH24:mi:ss'))";
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
In SQL monitor I saw
Part of the time after the colon is lostBEGIN
AAA(TO_DATE('20061222 17;
END;
Error occurred: [1756] (ORA-01756: quoted string not properly terminated
)
Version of code without time works correctly.
Code: Select all
cmd.CommandText = "USER.AAA(TO_DATE('20061222', 'yyyymmdd'))";
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.
Re: Migration Wizard problems
I'm trying to get CLOB
The lob.Value is:
If to set flag OracleUtils.OracleClientCompatible to false, the lob.Value is correct.
How can I get correct lob.Value with OracleUtils.OracleClientCompatible = true?
Code: Select all
OracleUtils.OracleClientCompatible = true;
OracleConnection conn = new OracleConnection(connStr);
conn.Open();
OracleCommand cmd = conn.CreateCommand();
cmd.CommandText = "select to_clob('111222') from dual";
var rdr = cmd.ExecuteReader();
rdr.Read();
var lob = rdr.GetOracleLob(0);
If to set flag OracleUtils.OracleClientCompatible to false, the lob.Value is correct.
How can I get correct lob.Value with OracleUtils.OracleClientCompatible = true?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We have fixed the bug with executing OracleCommand, having CommandType.StoredProcedure, when its CommandText contains a colon, which does not denote a stored procedure overload number. We will post here when the corresponding build of dotConnect for Oracle is available for download.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
We have also fixed the bug with reading CLOB data in the OracleUtils.OracleClientCompatible mode via the reader.GetOracleLob().Value and reader.GetOracleLob().Length properties and reader.GetOracleLob().Read() and reader.GetString() methods. We will post here when the corresponding build of dotConnect for Oracle is available for download.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Migration Wizard problems
New build of dotConnect for Oracle 9.7.770 is available for download.
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Devart Account (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38884
It can be downloaded from https://www.devart.com/dotconnect/oracle/download.html (trial version) or from Devart Account (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38884