Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Connection string error: Length Cannot be less than zero (no replies)

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

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>