[Mono-dev] System.Data.SqlConnection fails on 2nd invalid login attempt

Rob Wilkens robwilkens at gmail.com
Sun Apr 29 22:26:20 UTC 2012

To anyone following:

-We exchanged some messages off-list because that's the way my new phone 
replied by default for this particular list.. I am now back home and 
want to summarize the messages we exchanged.
-In summary:
      -He presumed the code was a complete test case, it wasn't...  It 
was part of a bigger program.
      -In other words - he missed the fact that this was an 'OnClick' 
event function, and it was called each time a log in was attempted by 
the user clicking the login button.  He did not originally comprehend 
that when i said 'subsequent attempts failed' (paraphrasing) i was 
referring to multiple calls to this function as a result of the button 
being clicked.
      -My code did in fact call open, but only once per function call - 
i can't imagine needing more than one SqlConnection per program, so it 
wouldn't make sense to call it more than once in one function.

So, in summary, i believe mono may still be broken.


On 04/29/2012 04:18 PM, Daniel Morgan wrote:
> I saw your example.
> SqlConnection with the constructor with the connnection string does 
> not automatically connect to the database.  You have to explicitly 
> call the Open method.
> Mono is working correctly.
> ------------------------------------------------------------------------
> *From:* Rob Wilkens <robwilkens at gmail.com>
> *To:* mono-devel-list at lists.ximian.com
> *Sent:* Friday, April 27, 2012 2:57 PM
> *Subject:* [Mono-dev] System.Data.SqlConnection fails on 2nd invalid 
> login attempt
> I probably shouldn't cross-post, but i wasn't sure where to put this, 
> or if i should file a bug report (I'm new-ish to mono).  After reading 
> the mailing list description, this seemed like a more appropriate 
> place to ask.
> First, let me say this is not a critical problem, and i'm not sure 
> whether it is a bug on mono or not.  I might be interested in trying 
> to fix this myself if i can figure out where to start (later), just as 
> a time waster project.
> When I create an SqlConnection called, say, MyConnection, and then 
> call MyConnection.Open() - the second time i call it (though the first 
> time with each new object it is called on) with an invalid login 
> name/password, it fails with what appears to be an exception message 
> that implies something was null when it shouldn't have been (object 
> reference not set to instance of an object).  If i call it with a 
> valid login name/password on any attempt, it doesn't raise any errors, 
> as is expected.
> From what i can tell, this is happening inside of MyConnection.Open() 
> ... and not in my code.  I've verified that MyConnection is not null 
> when i call Open().
> If you want to see sample code, i'll point you to my other post on 
> this topic:
> http://stackoverflow.com/questions/10355669/using-system-data-sqlconnection-in-mono-second-invalid-login-attempt-results-in 
> Does this sound like something i should file a bug on?  Also, if i'm 
> interested in contributing, would it be wisest to file a bug first, 
> then attempt to resolve it?
> -Rob
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com <mailto:Mono-devel-list at lists.ximian.com>
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120429/aa854f7d/attachment.html>

More information about the Mono-devel-list mailing list