I copied a single xml parameter (@xmlone) into three total, and now I get this error.
This code worked fine in Visual Studio and Xamarin, but complains in unity.
Column, parameter, or variable #4: Cannot specify a column width on data type xml.
UnityEngine.Debug:Log(Object)
inventory:reserve_id(Int32, String, String) (at Assets/scripts/inventory.cs:603)
public void reserve_id(int unique_id, string un, string pw)
{
Debug.Log("reserving ID...." + unique_id + " " + un + " " + pw);
//tmp_username = un;
//tmp_password = pw;
//tmp_id = unique_id.ToString();
tmp_username = un;
tmp_password = pw;
tmp_id = "16";
string InsertString = "INSERT INTO VALUES(@unique_id, @username, @password, @xmlone, @xmltwo, @xmlthree)"; //@xmltwo, @xmlthree
//Debug.Log(" " + InsertString);
using (SqlConnection sql_connection_a = new SqlConnection( GetConnectionString() ) )
{
sql_connection_a.Open();
using (SqlCommand command = new SqlCommand(InsertString))
{
command.Connection = sql_connection_a;
command.Parameters.Add("@unique_id", SqlDbType.Int, 5).Value = tmp_id;
command.Parameters.Add("@username", SqlDbType.VarChar, 20).Value = tmp_username;
command.Parameters.Add("@password", SqlDbType.VarChar, 20).Value = tmp_password;
command.Parameters.Add("@xmlone", SqlDbType.Xml).Value = create_XML(tmp_username).ToString(); //###
command.Parameters.Add("@xmltwo", SqlDbType.Xml).Value = create_XML(tmp_username).ToString(); //###
command.Parameters.Add("@xmlthree", SqlDbType.Xml).Value = create_XML(tmp_username).ToString(); //###
try
{
var result = command.ExecuteNonQuery();
Debug.Log("ID RESERVED SUCCESS");
Debug.Log(result.ToString());
}
catch(SqlException e)
{
Debug.Log("ID RESERVE FAILED");
Debug.Log(e.ErrorCode);
Debug.Log(e.Errors);
Debug.Log(e.Message);
}
finally
{
}
}
}
}