Connection string error: Length Cannot be less than zero
Posted by: Ben McMillan
Date: June 02, 2013 07:02PM

This connection string:

Data Source=localhost;UID=MYUID;Password=MYPWD;port=3306;connection timeout=10;Allow User Variables=true;ConvertZeroDateTime=true;

is giving me this error:

System.ArgumentOutOfRangeException: Length cannot be less than zero.
at String System.String.InternalSubStringWithChecks(System.Int32 startIndex, System.Int32 length, System.Boolean fAlwaysCopy)
at String System.String.Substring(System.Int32 startIndex, System.Int32 length)
at String MySql.Data.MySqlClient.MySqlConnectAttrs.get_ProgramName()
at Object System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object obj, System.Object[] parameters, System.Object[] arguments)
at Object System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
at Object System.Reflection.RuntimePropertyInfo.GetValue(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture)
at Object System.Reflection.RuntimePropertyInfo.GetValue(System.Object obj, System.Object[] index)
at System.Void MySql.Data.MySqlClient.NativeDriver.SetConnectAttrs()
at System.Void MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(System.Boolean reset)
at System.Void MySql.Data.MySqlClient.NativeDriver.Authenticate(System.String authMethod, System.Boolean reset)
at System.Void MySql.Data.MySqlClient.NativeDriver.Open()
at System.Void MySql.Data.MySqlClient.Driver.Open()
at static Driver MySql.Data.MySqlClient.Driver.Create(MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings)
at Driver MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at Driver MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at Driver MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at Driver MySql.Data.MySqlClient.MySqlPool.GetConnection()
at System.Void MySql.Data.MySqlClient.MySqlConnection.Open()


Any idea what I am doing wrong or how to fix?


EDIT: I was using MySQL Connection Net 6.7.2. If I revert to 6.6.4 I don't get this error



Edited 1 time(s). Last edit at 06/02/2013 07:24PM by Ben McMillan.

Options: ReplyQuote


Subject
Written By
Posted
Connection string error: Length Cannot be less than zero
June 02, 2013 07:02PM


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.