[Mono-bugs] [Bug 326011] New: Creating two connections to the same SQL database throws an exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 18 10:14:50 EDT 2007


           Summary: Creating two connections to the same SQL database throws
                    an exception
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Sys.Data.SqlClient
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: paul at digitaltinder.com
         QAContact: mono-bugs at ximian.com
          Found By: Third Party Developer/Partner

Created an attachment (id=173086)
 --> (https://bugzilla.novell.com/attachment.cgi?id=173086)
A sample of the problem

I have a similar (but not identical) issue to Bug 320311.

I have a sample application which has a form and two drop down lists.  I have
code that calls a method (passing it a SQL string) which will connect to a SQL
server execute the SQL string and return a data table.  The first time I get
data using the method everything works fine.  But the second time I call it, I
get an exception saying "SQL Server does not exist or access denied"  This
application runs perfectly using MS .Net 2.0.

Steps to Reproduce: 
1. Create code to create a SQLConnection, SQLCommand, and use a SQLDataAdapter
to fill a dataset.
2. Copy and past that code so that it executes twice in a row. (You may need to
modify it so that you don't declare the same variable names twice)
3. Run the code.

Actual Results:
The application crashes... but if you put in some error handling you can catch
an SQL Exception which says "SQL Server does not exist or access denied"

Expected Results:
The application should be able to open two consecutive connections to the same

Build Date & Platform: 
2007-09-18 - Intel x86 (Windows XP)

Additional Information:
Using the sample application, you can run either the "CodeThatWorks" method or
the "CodeThatBreaks" method.  Both do almost identical work.  You must only run
ONE of the two at any given time, since after you have created one connection
to the database all others seem to fail. e.g. if you run CodeThatBreaks() and
then CodeThatWorks() then CodeThatWorks will fail too.  So only ever have one
of the two lines in Form1_Load uncommented at any one time.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list