Unable to create SqlConnction with "Integraded Security=SSPI" connection string on Mono 5.16.0.179 (Linux)

0

I'm trying to port my application to Mono and I'm currently testing connecting to a Microsoft SQL Server 2008 to retrieve and insert test data. The server requires Windows Authentication but when providing Integrated Security in the connection string, a Specific method is not supported exception is thrown. When removing it, the authentication just fails (as expected). Is it possible to create an SqlConnection (and commands etc) in Mono running Ubuntu 18.04 with integrated security? I am able to connect by using ODBC drivers but would prefer specific SQL functions such as table valued parameters.

Here's the connection string

private const string ConnectionString = "Server=server;Database=database;User Id=Domain\\User;Password=password;Integrated Security=SSPI;Max Pool Size=500;Min Pool Size=10;Pooling=true;Connection Timeout=5;Application Name=SqlStructuredDataTest";

The exception is thrown when trying to call sqlConnection.Open()

using (SqlConnection sqlConnection = new SqlConnection(ConnectionString))
    {
        sqlConnection.Open();

        using (SqlCommand sqlCommand = sqlConnection.CreateCommand())
        {
            sqlCommand.CommandText = "usp_StructuredInsertTest";
            sqlCommand.CommandType = CommandType.StoredProcedure;

            AddStructuredInsertTestItemsParams(sqlCommand.Parameters, structuredInsertTestItems);

            sqlCommand.ExecuteNonQuery();
        }
    }

System.Data.SqlClient.SqlException (0x80131904): Specified method is not supported.

c#
.net
linux
mono
windows-authentication
asked on Stack Overflow Nov 2, 2018 by Brandon • edited Nov 2, 2018 by Brandon

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0