public void Test()
{
Debug.Log("Connecting to database...");
string connectionstring = @"Data Source = 127.0.0.1;
user id = sa;
password = test;
Initial Catalog = test;";
SqlConnection conn = new SqlConnection(connectionstring);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "insert into Test(이름 ,아이디 , 비밀번호) values(@이름, @아이디 ,@비밀번호)";
cmd.Parameters.AddWithValue("@이름", "name");
cmd.Parameters.AddWithValue("@아이디", "id");
cmd.Parameters.AddWithValue("@비밀번호", "pwd");
try
{
conn.Open();
cmd.ExecuteNonQuery();
Debug.Log("Connected to database.");
}
catch(Exception ex)
{
Debug.Log(ex);
}
conn.Close();
}
errorcode : System.Data.SqlClient.SqlException (0x80131904): Snix_Login (provider: SNI_PN7, error: 0 - 작업을 완료했습니다.)
I Trying to connect Unity and MSSQL What's the problem? Please Help Me
User contributions licensed under CC BY-SA 3.0