2

I have done a small c# windows application. From that, I open a sql port from my SQL Server and I use it to access my server. When the application runs on XP it's working fine.

But when I want to run it on Windows 7 it's not running... do I have to do anything special in Windows 7? Suppose my SQL port is 1868... what should I have to do with that Windows 7 machine?

Thanks for ideas...

My connection string..

Data Source=192.158.2.70,1868;initial Catalog=Accounts;User Id=janani;Password=abcd"
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
LOGAN
  • 35
  • 1
  • 6
  • Windows XP or Windows 7 - you shouldn't have problems using the same connection string. Are you sure the windows 7 machine have all the access to the SQL server? Is it on the same network? – Otiel Nov 18 '11 at 19:20
  • 2
    Is that a comma between the ip and the port? Surely it should be a : – Haedrian Nov 18 '11 at 19:21
  • 2
    Actually strangely enough, a comma does work. A colleague of mine did that the other da => see http://stackoverflow.com/questions/5294721/how-to-specify-a-port-number-in-sql-server-connection-string – Ta01 Nov 18 '11 at 19:22
  • Yes. Same network..same system... – LOGAN Nov 18 '11 at 19:24
  • Have you checked Windows firewall setting to make sure it allows the outbound connection on that port? http://technet.microsoft.com/en-us/library/cc947789%28WS.10%29.aspx – Ta01 Nov 18 '11 at 19:27
  • 5
    A comma is mandatory to specify the port. A colon does *not* work for a SQL Server connection string. – Julien Lebosquain Nov 18 '11 at 19:27
  • @Haedrian: **NO** - the IP and port in a SQL Server connection string are **indeed** separated by a **comma** - [ConnectionStrings.com](http://www.connectionstrings.com/sql-server-2008), about halfway down - "connect via an IP address" – marc_s Nov 18 '11 at 19:52

1 Answers1

1

have you checked your firewall settings? http://msdn.microsoft.com/en-us/library/ms175043.aspx

NickD
  • 2,672
  • 7
  • 37
  • 58