{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/core/issues/1264","repository_url":"https://api.github.com/repos/dotnet/core","labels_url":"https://api.github.com/repos/dotnet/core/issues/1264/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/core/issues/1264/comments","events_url":"https://api.github.com/repos/dotnet/core/issues/1264/events","html_url":"https://github.com/dotnet/core/issues/1264","id":296017307,"number":1264,"title":"Issue connecting to MS SQL Server running on non default port 1433","user":{"login":"mahesji","id":32984351,"avatar_url":"https://avatars3.githubusercontent.com/u/32984351?v=4","gravatar_id":"","url":"https://api.github.com/users/mahesji","html_url":"https://github.com/mahesji","followers_url":"https://api.github.com/users/mahesji/followers","following_url":"https://api.github.com/users/mahesji/following{/other_user}","gists_url":"https://api.github.com/users/mahesji/gists{/gist_id}","starred_url":"https://api.github.com/users/mahesji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahesji/subscriptions","organizations_url":"https://api.github.com/users/mahesji/orgs","repos_url":"https://api.github.com/users/mahesji/repos","events_url":"https://api.github.com/users/mahesji/events{/privacy}","received_events_url":"https://api.github.com/users/mahesji/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-09T21:27:16Z","updated_at":"2018-02-10T00:10:41Z","closed_at":null,"author_association":"NONE","body":"# Issue Title\r\n\r\nIssue connecting to MS SQL Server running on non default port 1433 from Linux environment \r\n\r\n**OS Version**\r\nLinux 4.4.0-109-generic #132~14.04.1-Ubuntu SMP Tue Jan 9 21:46:42 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\ndotnet core project settings \r\n```\r\n<Project Sdk=\"Microsoft.NET.Sdk.Web\">\r\n\r\n  <PropertyGroup>\r\n    <TargetFramework>netcoreapp2.0</TargetFramework>\r\n    <RuntimeFrameworkVersion>2.0.5</RuntimeFrameworkVersion>\r\n  </PropertyGroup>\r\n\r\n  <ItemGroup>\r\n    <Folder Include=\"wwwroot\\\" />\r\n  </ItemGroup>\r\n\r\n  <ItemGroup>\r\n    <PackageReference Include=\"Microsoft.AspNetCore.All\" Version=\"2.0.5\" />\r\n    <PackageReference Include=\"System.Data.SqlClient\" Version=\"4.4.2\" />\r\n  </ItemGroup>\r\n\r\n  <ItemGroup>\r\n    <DotNetCliToolReference Include=\"Microsoft.VisualStudio.Web.CodeGeneration.Tools\" Version=\"2.0.2\" />\r\n  </ItemGroup>\r\n\r\n</Project>\r\n\r\n```\r\n# General\r\nUsing System.Data.SqlClient to connect to Sql server database. Following the sample in this post https://blogs.msdn.microsoft.com/dotnet/2016/11/09/net-core-data-access/\r\n\r\nIt works fine if the sql server is listening on port 1433 but fails when connecting to sql servers listening on port 1434. Confirmed that there is no network / firewall issues that that is blocking the ports. Able to connect to the same sql server on port 1434 using java code.\r\nThis connection string works >\r\nServer=myhostname,1433;Database=mydatabase;User Id=myuser;Password=mypassword;\r\nThis connection string does not work in above linux environment.  Works fine on windows\r\nServer=myhostname,1434;Database=mydatabase;User Id=myuser;Password=mypassword;\r\n\r\nBoth connect strings work fine in Windows environment.\r\n\r\nRecord Fetch Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)"},"comment":{"url":"https://api.github.com/repos/dotnet/core/issues/comments/364605423","html_url":"https://github.com/dotnet/core/issues/1264#issuecomment-364605423","issue_url":"https://api.github.com/repos/dotnet/core/issues/1264","id":364605423,"user":{"login":"usergiga","id":34147274,"avatar_url":"https://avatars0.githubusercontent.com/u/34147274?v=4","gravatar_id":"","url":"https://api.github.com/users/usergiga","html_url":"https://github.com/usergiga","followers_url":"https://api.github.com/users/usergiga/followers","following_url":"https://api.github.com/users/usergiga/following{/other_user}","gists_url":"https://api.github.com/users/usergiga/gists{/gist_id}","starred_url":"https://api.github.com/users/usergiga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usergiga/subscriptions","organizations_url":"https://api.github.com/users/usergiga/orgs","repos_url":"https://api.github.com/users/usergiga/repos","events_url":"https://api.github.com/users/usergiga/events{/privacy}","received_events_url":"https://api.github.com/users/usergiga/received_events","type":"User","site_admin":false},"created_at":"2018-02-10T00:10:41Z","updated_at":"2018-02-10T00:10:41Z","author_association":"NONE","body":"If an instance of SQL Server is listening on any other port, than 1433. You have to specify a server-alias or change the standard port globally. \r\nYou can have SQL Server listening on multiple ports. "}}
{"actor":{"display_login":"usergiga"}}