Not able to connect to SQL Server Database due to SSL encryption not being implemented
I'm trying to setup a connection between Unity and a SQL Server Database, but I am currently unable to do so due to SSL encryption. Here's the actual error
Here's the code I'm using to try to make the connection
using System;
using System.Data;
using System.Data.SqlClient;
namespace DB.Services
{
public class DBServices
{
private const string _connectionString = @"Data Source=localhost\SQLEXPRESS;Initial Catalog=Players;Integrated Security=True;Trusted Connection=True";
private SqlConnection _db;
public string ConnectToDB()
{
_db = new SqlConnection(_connectionString);
_db.Open();
if (_db.State != ConnectionState.Open)
return "Connection failed";
var users = GetUsers();
return users;
}
private string GetUsers(){
var query = "SELECT * FROM Player";
SqlDataAdapter cmd = new SqlDataAdapter(query, _db);
var result = cmd.SelectCommand.ExecuteNonQuery();
_db.Close();
return result.ToString();
}
}
}
Every other question I've seen has suggested that the connection string have 'Trusted Connection=True'. However, I continue to get the SSL encryption error.
Can anyone tell me what I'm doing wrong and what I need to do to fix it?
Your answer
Follow this Question
Related Questions
HTTP Request - error:UNITYTLS_X509VERIFY_NOT_DONE 0 Answers
nothing called after WaitForSeconds 1 Answer
Why does my camera rotate on the x axis because of this script? What is wrong with the script? 0 Answers
How Do I Create a List of Two Strings? C# 1 Answer
How to remove flashing screen when changing Canvas Render Modes 0 Answers