25-11-2018, Saat: 14:25
Selam arkadaşlar. Bir proje için MSSQL SERVER'a bağlanmaya çalışıyorum. Aşağıdaki hatayı alıyorum. Unity ile direk MSSQL'e bağlanmak mumkun mu onu da tam anlayamadım. Yani bazı forumlarda web servis kullanılması gerektiğini söyleyen olmuş.
catch message - SQL Server does not exist or access denied.
UnityEngine.Debug:Log(Object)
DatabaseManager:baglan() (at Assets/Scripts/DatabaseManager.cs:36)
DatabaseManager:Start() (at Assets/Scripts/DatabaseManager.cs:21)
Bağlantı kodum şöyle:
static string connectionString1 = @"Server=PC\SQL;" + "Database=Db_S;" + "User ID=sa;" + "Password=123;" + "Integrated Security=True";
SqlConnection conn = new SqlConnection(connectionString1);
private void Start()
{
baglan();
}
// BAĞLAN
public void baglan()
{
try
{
if (conn.State == ConnectionState.Closed)
conn.Open();
}
catch (Exception e)
{
Debug.Log("catch message - " + e.Message);
}
}
catch message - SQL Server does not exist or access denied.
UnityEngine.Debug:Log(Object)
DatabaseManager:baglan() (at Assets/Scripts/DatabaseManager.cs:36)
DatabaseManager:Start() (at Assets/Scripts/DatabaseManager.cs:21)
Bağlantı kodum şöyle:
static string connectionString1 = @"Server=PC\SQL;" + "Database=Db_S;" + "User ID=sa;" + "Password=123;" + "Integrated Security=True";
SqlConnection conn = new SqlConnection(connectionString1);
private void Start()
{
baglan();
}
// BAĞLAN
public void baglan()
{
try
{
if (conn.State == ConnectionState.Closed)
conn.Open();
}
catch (Exception e)
{
Debug.Log("catch message - " + e.Message);
}
}