Subi um docker com sql server (com essa imagem mcr.microsoft.com/azure-sql-edge), fiz a connexão do sql server na extensão do vscode, mas não aprece a opção de extração automática da stringConnection. Então creiri a string baseada no que achei pela internet, mas continua dando esse erro: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught).
A função de conexão está dessa forma:
public SqlConnection doConnection(){
string serverAddress = "localhost";
string port = "1433";
string databaseName = "screenSound";
string username = "SA";
string password = "StrongPass123!";
string connectionString = $"Data Source={serverAddress},{port};Initial Catalog={databaseName};User ID={username};Password={password};";
return new SqlConnection(connectionString);
}
E esses são os logs do container:
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpad] [6103e030] [00000001] INFO: Logging stopped for 00000001-0000-002a-0000-080000000100
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpad] [6103e030] [00000001] WARNING: Error waiting for external service process waitid: no child processes
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpad] [6103e030] [00000001] INFO: Pid 206 exited with status 0 for SessionID:00000001-0000-002a-0000-080000000100
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpad] [6103e030] [00000001] INFO: All current child processes have exited. SessionID:00000001-0000-002a-0000-080000000100
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: Received packet of type 18 [MessageTypeXdbDataPackageStop]
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: Packet header: &{Version:1 TypeAndEndOfMessageBit:32786 PacketSizeInBytes:40 SessionID:132b5612-8e1d-4c50-8681-062137fd1dda}
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: DataPackageStop message is received with package GUID 6103e030-0f84-44aa-bbe5-eb231a8e3eb1.
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: Launchpad of package GUID 6103e030-0f84-44aa-bbe5-eb231a8e3eb1 found in the store.
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: Launchpad of package GUID 6103e030-0f84-44aa-bbe5-eb231a8e3eb1 is terminated.
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: resume after receiving stop message.
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: Sending message of type 19 [MessageTypeXdbPackageResume], SessionID:132b5612-8e1d-4c50-8681-062137fd1dda
2024-03-22 11:31:10 2024/03/22 14:31:10 [launchpadd] [6103e030] INFO: Sent message of type 19 [MessageTypeXdbPackageResume], SessionID:132b5612-8e1d-4c50-8681-062137fd1dda
The login info is removed from the store and destroyed.