using UnityEngine;
using System.Data.SqlClient;
using TMPro;
public class SqlConnectionScript : MonoBehaviour
{
private string cs;
public TextMeshProUGUI txtToSql;
void Start()
{
cs = @"Data Source =192.168.1.2,1433;Initial Catalog=AccountDB;User ID=sa;Password=gamedb;";
}
public void ToSql()
{
SqlConnection SqlConn = new SqlConnection(cs);
SqlConn.Open();
SqlCommand cmd = new SqlCommand("INSERT web_epin (Code, Value, Type, Available) VALUES('" + txtToSql.text + "','28000','1','1')", SqlConn);
cmd.ExecuteNonQuery();
SqlConn.Close();
}
}
Error Log:
NotSupportedException: Encoding 1252 data could not be found. Make sure you have correct international codeset assembly installed and enabled.
I'm using sql server 2014 express
my DB is SQL_Latin1_General_CP1_CI_AS
↧