MySQL Forums
Forum List  »  Connector/C++

Re: Unity Android MySQL connection function failing: Index was outside the bounds of the array.
Posted by: James Coyle
Date: January 01, 2019 11:25AM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Unity Android MySQL connection function failing: Index was outside the bounds of the array.
670
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.