Hi,
We are using .netcore 3.1
and
Devart internal build https://download.devart.com/nuget_oracle_9_10_921.zip .
We have already shared the sample project with you. [39708]
After executing this query in LINQ we got Character set mismatch error.
Linq query
(from lst in _ControlfileRepository.GetAll()
select new ControlFileCORE()
{
COL_NAME = lst.COL_NAME == "" ? "" : lst.COL_NAME,
VALUE = lst.VALUE == "" ? "" : lst.VALUE,
Id = lst.Id
}).ToList();
Oracle Query generated by this LINQ query is:
SELECT CASE
WHEN c.COL_NAME IS NULL THEN N''
ELSE c.COL_NAME
END COL_NAME, CASE
WHEN c.VALUE IS NULL THEN N''
ELSE c.VALUE
END VALUE, c.Id
FROM CONTROLFILE c
How can we handle this?
[In the previous version of .net this is working fine]
Please help us to solve this issue.
ORA : Character set mismatch
Re: ORA : Character set mismatch
.netCore 3.1
To solve this issue temporarily. Add Entity framework interceptor like this
add this interceptor in
This will solve the character set mismatch issue in EFCORE 3.1
To solve this issue temporarily. Add Entity framework interceptor like this
Code: Select all
public class NVarcharInterceptor : DbCommandInterceptor
{
public override InterceptionResult<DbDataReader> ReaderExecuting(System.Data.Common.DbCommand dbCommand,
Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData,
Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<DbDataReader> result)
{
if (dbCommand.CommandText.Contains("N''"))
{
dbCommand.CommandText = dbCommand.CommandText.Replace("N''", "''");
}
return base.ReaderExecuting(dbCommand, eventData, result);
}
}
add this interceptor in
Code: Select all
DbContextOptionsBuilder<DbContext> builder
builder.AddInterceptors(new NVarcharInterceptor())
Re: ORA : Character set mismatch
There are no _ControlfileRepository variable and ControlFileCORE class in your DpSecureNSDLDemo test project. Please upload an updated test project to some file exchange server and send us the download link.