I deployed my app, done in ASP.NET Core MVC, on the server, in IIS.
However, an error appears when I pass the first screens of my app… It seems to be a problem in the querying of the database. Here is the error:
"""
Hosting environment: Production
Content root path: C:\My\MySitev1
Now listening on: http://127.0.0.1:13624
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.Data.SqlClient.SqlException (0x80131904): Cannot resolve the collation co
nflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AI" in the
like operation.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run
Behavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBe
havior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 time
out, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
"""
Is this in fact a problem in the querying of the database?
Member
7 Points
18 Posts
ASP.NET, SQL Server : problem in querying the database
Feb 03, 2020 12:38 PM|JDias|LINK
I deployed my app, done in ASP.NET Core MVC, on the server, in IIS.
However, an error appears when I pass the first screens of my app… It seems to be a problem in the querying of the database. Here is the error:
"""
Hosting environment: Production
Content root path: C:\My\MySitev1
Now listening on: http://127.0.0.1:13624
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.Data.SqlClient.SqlException (0x80131904): Cannot resolve the collation co
nflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AI" in the
like operation.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run
Behavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBe
havior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 time
out, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
"""
Is this in fact a problem in the querying of the database?
What configuration should I change?
All-Star
123252 Points
10024 Posts
Moderator
Re: ASP.NET, SQL Server : problem in querying the database
Feb 03, 2020 03:02 PM|limno|LINK
Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AI" in the like operation.
Check your query for the LIKE keyword. You can try to change the collation at your query level to make both columns compatible in collation.
Format your SQL query with instant sql formatter:
http://www.dpriver.com/pp/sqlformat.htm