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
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