Re: Unity Android MySQL connection function failing: Index was outside the bounds of the array.
After doing some more testing using another client with some basic code:
void Start ()
{
connection = new MySqlConnection(connectionString);
connection.Open();
command = new MySqlCommand("SELECT Item_Name FROM tbl_Store;", connection);
MySqlDataReader reader = command.ExecuteReader();
text = GameObject.Find("Text").GetComponent<Text>();
reader.Read();
text.text = reader["Item_Name"].ToString();
}
I got this full error message:
01-01 17:23:48.307: E/Unity(10476): IndexOutOfRangeException: Index was outside the bounds of the array.
01-01 17:23:48.307: E/Unity(10476): at System.Diagnostics.TraceInternal.get_AppName () [0x0000e] in <ac210d81537245bc838518cc8e845861>:0
01-01 17:23:48.307: E/Unity(10476): at System.Diagnostics.TraceInternal.TraceEvent (System.Diagnostics.TraceEventType eventType, System.Int32 id, System.String format, System.Object[] args) [0x0003d] in <ac210d81537245bc838518cc8e845861>:0
01-01 17:23:48.307: E/Unity(10476): at System.Diagnostics.Trace.TraceError (System.String message) [0x00000] in <ac210d81537245bc838518cc8e845861>:0
01-01 17:23:48.307: E/Unity(10476): at MySql.Data.MySqlClient.MySqlTrace.LogError (System.Int32 id, System.String msg) [0x00028] in <326e9aab93854e739606c3572c385a34>:0
01-01 17:23:48.307: E/Unity(10476): at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver () [0x00031] in <326e9aab93854e739606c3572c385a34>:0
01-01 17:23:48.307: E/Unity(10476): at MySql.Data.MySqlClient.MySqlPool.GetConnection () [0x0001c] in <326e9aab93854e739606c3572c385a34>:0
01-01 17:23:48.307: E/Unity(10476): at MySql.Data.MySqlClient.MySqlConnection.Open () [0x000f3] in <326e9aab93854e739606c3572c385a34>:0
01-01 17:23:48.307: E/Unity(10476): at texttest1.Start () [0x00011] in <dd75ac8e3f854a97ac132dae6ec658fd>:0
Subject
Views
Written By
Posted
1988
January 01, 2019 10:20AM
Re: Unity Android MySQL connection function failing: Index was outside the bounds of the array.
688
January 01, 2019 11:25AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.