Bug 22803 - SqlConnection.ParseDataSource method fails with "Input string is not in the correct format" error when port and instance are specified
Summary: SqlConnection.ParseDataSource method fails with "Input string is not in the c...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 3.8.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-09 19:17 UTC by Jon Goldberger [MSFT]
Modified: 2018-02-22 22:36 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jon Goldberger [MSFT] 2014-09-09 19:17:25 UTC
Created attachment 7975 [details]
Test Project

## Description:

When setting an SqlConnection string with a DataSource that specifies a port and an instance, like:
server.dns.name,11433\instance
an "Input string is not in the correct format" exception is thrown by SqlConnection.ParseDataSource.
I tested this in a console app built against the .NET framework and this exception did _not_ occur.

## Steps to reproduce

1. Open the attached test project in Xamarin Studio on a Mac (test project is a Xam.Mac app)
2. Run the app project.
3. Enter 
server.dns.name,11433\instance
in the Data Source text field.
4. Press the Test button.

## Expected result: 
Connection string will be parsed without throwing exception (but no connection will be made as there is no server)

## Actual result: 
Parsing the connection string fails with the above mentioned error. 

----------------------------
My Xamarin Studio Version info:

=== Xamarin Studio ===

Version 5.3 (build 440)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Runtime:
	Mono 3.8.0 ((no/45d0ba1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000009

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.2   (API level 8)
		2.3   (API level 10)
		3.0   (API level 11)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.Mac ===

Version: 1.10.0.10 (Business Edition)

=== Xamarin.iOS ===

Version: 7.4.0.108 (Business Edition)
Hash: 77efa3f
Branch: 
Build date: 2014-08-26 07:59:55-0400

=== Build Information ===

Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859

=== Operating System ===

Mac OS X 10.9.4
Darwin Jonathans-MacBook-Pro.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 1 Rodrigo Kumpera 2016-04-14 05:54:57 UTC
Moving back to the pool, as I'm not the maintainer.
Comment 2 Marek Safar 2018-02-22 22:36:17 UTC
Mono 5.10 has significantly improved System.Data implementation which should resolve this issue. If you can still reproduce it please reopen the issue.