I am currently using C sharp .net 6 and connecting to a database using System.Data.SqlClient.
When it attempts to read from a table, it returns the error: The Collation specified by SQL Server is not supported.
private const string SQLUSERS= @"SELECT * FROM USERS ORDER BY ID COLLATE German_PhoneBook_CI_AI;";
SqlConnection connection = new("...");
connection.Open();
try
{
using SqlCommand command = new(SQLUSERS, connection);
using SqlDataReader reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
...
}
The current server collation is German_PhoneBook_CI_AI and it is not possible for me to change it. Any alternatives to resolve this issue with the code and without using EF Core?