How to access a SQL Server database from other computer connected to the same workgroup?I can't connect to an...

What does "don't have a baby" imply or mean in this sentence?

Can a planet be tidally unlocked?

How can changes in personality/values of a person who turned into a vampire be explained?

How can I differentiate duration vs starting time

Coworker is trying to get me to sign his petition to run for office. How to decline politely?

Was the Soviet N1 really capable of sending 9.6 GB/s of telemetry?

Last Reboot commands don't agree

How do I write a maintainable, fast, compile-time bit-mask in C++?

Are all power cords made equal?

Is Screenshot Time-tracking Common?

Rudeness by being polite

TikZtree with asymmetric siblings

What is the difference between crontab -e and nano /etc/crontab?

How bad is a Computer Science course that doesn't teach Design Patterns?

STM32 PWM problem

Aligning Systems of Equations

Is it possible to detect 100% of SQLi with a simple regex?

The Longest Chess Game

Manager has noticed coworker's excessive breaks. Should I warn him?

Is it ethical to apply for a job on someone's behalf?

Is there any danger of my neighbor having my wife's signature?

Microphone on Mars

How to scroll to next div using Javascript?

How can guns be countered by melee combat without raw-ability or exceptional explanations?



How to access a SQL Server database from other computer connected to the same workgroup?


I can't connect to an instance of SSMS from other servers SSMSSQL Server 2008 R2 hamachi connectionHow do I make SQL Server database accessible to PC's on the LAN?Error trying to open databaseerror connect to serverHowto use Windows Authentication with SQL Server 2008 Express on a workgroup network?error connect to serverHow to add SQL Server in networks list?Can't connect to remote SQL server from some machinesSql Database server Remote access not workingReporting Services will not connect to SQL ServerClassic ASP Connection to SQL Server 2014 without TLS 1.0 using ADODB.ConnectionHow to connect to a password protected Access 2010 database from SQL Server 2014 x64SQL Server Management Studio DAC connection errorHow are other computers able to connect to my database













11















I have created a C# application which uses a SQL Server database. I have other computers connected to me and to each other in a workgroup. I have shared my C# application with others. When they open the application they get the error




A network related or instance-specific error occured while establishing a connection to SQL Server. the server was not found or was not accessible




But the application is working fine on my PC. The connection string I am using is



Data Source=ASHISHPC1SQLEXPRESS;Initial Catalog=ACW;User ID=ash159;Password=ashish159


which is stored in a .config file.



The application is working fine on my PC. What must I do? I have enabled the TCP/IP in the server but the same error persists. Some change in connection string or something else?










share|improve this question















migrated from stackoverflow.com Aug 24 '13 at 18:54


This question came from our site for professional and enthusiast programmers.














  • 1





    try using the IP address for 'data source'

    – Mitch Wheat
    Aug 24 '13 at 10:08






  • 1





    Try to Turn Off Windows Firewall...also check technet.microsoft.com/en-us/library/hh231672.aspx .This should work for you.

    – Kishan Gajjar
    Aug 24 '13 at 11:47






  • 3





    Turning off Windows Firewall is not required -- please stop propagating that myth! See my answer below.

    – Jon Seigel
    Jan 21 '14 at 20:03
















11















I have created a C# application which uses a SQL Server database. I have other computers connected to me and to each other in a workgroup. I have shared my C# application with others. When they open the application they get the error




A network related or instance-specific error occured while establishing a connection to SQL Server. the server was not found or was not accessible




But the application is working fine on my PC. The connection string I am using is



Data Source=ASHISHPC1SQLEXPRESS;Initial Catalog=ACW;User ID=ash159;Password=ashish159


which is stored in a .config file.



The application is working fine on my PC. What must I do? I have enabled the TCP/IP in the server but the same error persists. Some change in connection string or something else?










share|improve this question















migrated from stackoverflow.com Aug 24 '13 at 18:54


This question came from our site for professional and enthusiast programmers.














  • 1





    try using the IP address for 'data source'

    – Mitch Wheat
    Aug 24 '13 at 10:08






  • 1





    Try to Turn Off Windows Firewall...also check technet.microsoft.com/en-us/library/hh231672.aspx .This should work for you.

    – Kishan Gajjar
    Aug 24 '13 at 11:47






  • 3





    Turning off Windows Firewall is not required -- please stop propagating that myth! See my answer below.

    – Jon Seigel
    Jan 21 '14 at 20:03














11












11








11


8






I have created a C# application which uses a SQL Server database. I have other computers connected to me and to each other in a workgroup. I have shared my C# application with others. When they open the application they get the error




A network related or instance-specific error occured while establishing a connection to SQL Server. the server was not found or was not accessible




But the application is working fine on my PC. The connection string I am using is



Data Source=ASHISHPC1SQLEXPRESS;Initial Catalog=ACW;User ID=ash159;Password=ashish159


which is stored in a .config file.



The application is working fine on my PC. What must I do? I have enabled the TCP/IP in the server but the same error persists. Some change in connection string or something else?










share|improve this question
















I have created a C# application which uses a SQL Server database. I have other computers connected to me and to each other in a workgroup. I have shared my C# application with others. When they open the application they get the error




A network related or instance-specific error occured while establishing a connection to SQL Server. the server was not found or was not accessible




But the application is working fine on my PC. The connection string I am using is



Data Source=ASHISHPC1SQLEXPRESS;Initial Catalog=ACW;User ID=ash159;Password=ashish159


which is stored in a .config file.



The application is working fine on my PC. What must I do? I have enabled the TCP/IP in the server but the same error persists. Some change in connection string or something else?







sql-server connectivity






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 mins ago









Community

1




1










asked Aug 24 '13 at 9:54







ash











migrated from stackoverflow.com Aug 24 '13 at 18:54


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Aug 24 '13 at 18:54


This question came from our site for professional and enthusiast programmers.










  • 1





    try using the IP address for 'data source'

    – Mitch Wheat
    Aug 24 '13 at 10:08






  • 1





    Try to Turn Off Windows Firewall...also check technet.microsoft.com/en-us/library/hh231672.aspx .This should work for you.

    – Kishan Gajjar
    Aug 24 '13 at 11:47






  • 3





    Turning off Windows Firewall is not required -- please stop propagating that myth! See my answer below.

    – Jon Seigel
    Jan 21 '14 at 20:03














  • 1





    try using the IP address for 'data source'

    – Mitch Wheat
    Aug 24 '13 at 10:08






  • 1





    Try to Turn Off Windows Firewall...also check technet.microsoft.com/en-us/library/hh231672.aspx .This should work for you.

    – Kishan Gajjar
    Aug 24 '13 at 11:47






  • 3





    Turning off Windows Firewall is not required -- please stop propagating that myth! See my answer below.

    – Jon Seigel
    Jan 21 '14 at 20:03








1




1





try using the IP address for 'data source'

– Mitch Wheat
Aug 24 '13 at 10:08





try using the IP address for 'data source'

– Mitch Wheat
Aug 24 '13 at 10:08




1




1





Try to Turn Off Windows Firewall...also check technet.microsoft.com/en-us/library/hh231672.aspx .This should work for you.

– Kishan Gajjar
Aug 24 '13 at 11:47





Try to Turn Off Windows Firewall...also check technet.microsoft.com/en-us/library/hh231672.aspx .This should work for you.

– Kishan Gajjar
Aug 24 '13 at 11:47




3




3





Turning off Windows Firewall is not required -- please stop propagating that myth! See my answer below.

– Jon Seigel
Jan 21 '14 at 20:03





Turning off Windows Firewall is not required -- please stop propagating that myth! See my answer below.

– Jon Seigel
Jan 21 '14 at 20:03










5 Answers
5






active

oldest

votes


















17














There are two levels of security that need to be changed in order to allow remote access.




  1. SQL Server configuration. By default in Express, Developer, and Enteprise Evaluation editions, connecting by the TCP/IP protocol is disabled. Enable this using SQL Server Configuration Manager.



  2. Windows Firewall. While disabling the firewall entirely will work for this component, doing so is not a security best-practice (nor is it required). (Note: in this section, I assume a default configuration. There are many settings that can be changed which affect these steps slightly.)



    There are two cases depending on the type of SQL Server instance you're connecting to:




    1. Default instance (connect by computer name only). Add an allow incoming rule either on TCP port 1433 or the database engine service.


    2. Named instance (connect by computer name + instance name). Add an allow incoming rule on UDP port 1434 to access to the SQL Browser service. Add an allow incoming rule on the database engine service.





This procedure is fully documented here, or you can watch me explain and then walk through the configuration for a named instance here.






share|improve this answer

































    0














    You have to set the correct Network-Settings in your SQL-Server:
    Active TCP/IP in SQL-Server
    Also be sure, that your Server Browser-Service is running, because if it is stopped, you can't access the SQL-Server.






    share|improve this answer































      0














      Be sure sqlbrowser service is turned on as mentioned by bendeg, and that UDP 1434 is open on your machine so clients can hit the sqlbrowser in order to resolve the name. Also open the named instance's TCP/IP port.



      To find your instance's port, connect using the tcp: prefix in Management Studio like so: tcp:ASHISHPC1SQLEXPRESS and the result of the query below should be the port you need to expose to the clients in your workgroup.



      SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID





      share|improve this answer































        -1














        I turned the windows firewall off for Home Network and it worked fine.. Thank you all.. :)






        share|improve this answer



















        • 5





          If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

          – jcolebrand
          Aug 27 '13 at 19:28



















        -1














        Your SQL server must allow TCP/IP connections and you Windows Firewall must be turned off for Home Network.
        http://learnadvancecsharp.blogspot.in/2013/09/how-to-access-sql-server-database-from.html






        share|improve this answer





























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          17














          There are two levels of security that need to be changed in order to allow remote access.




          1. SQL Server configuration. By default in Express, Developer, and Enteprise Evaluation editions, connecting by the TCP/IP protocol is disabled. Enable this using SQL Server Configuration Manager.



          2. Windows Firewall. While disabling the firewall entirely will work for this component, doing so is not a security best-practice (nor is it required). (Note: in this section, I assume a default configuration. There are many settings that can be changed which affect these steps slightly.)



            There are two cases depending on the type of SQL Server instance you're connecting to:




            1. Default instance (connect by computer name only). Add an allow incoming rule either on TCP port 1433 or the database engine service.


            2. Named instance (connect by computer name + instance name). Add an allow incoming rule on UDP port 1434 to access to the SQL Browser service. Add an allow incoming rule on the database engine service.





          This procedure is fully documented here, or you can watch me explain and then walk through the configuration for a named instance here.






          share|improve this answer






























            17














            There are two levels of security that need to be changed in order to allow remote access.




            1. SQL Server configuration. By default in Express, Developer, and Enteprise Evaluation editions, connecting by the TCP/IP protocol is disabled. Enable this using SQL Server Configuration Manager.



            2. Windows Firewall. While disabling the firewall entirely will work for this component, doing so is not a security best-practice (nor is it required). (Note: in this section, I assume a default configuration. There are many settings that can be changed which affect these steps slightly.)



              There are two cases depending on the type of SQL Server instance you're connecting to:




              1. Default instance (connect by computer name only). Add an allow incoming rule either on TCP port 1433 or the database engine service.


              2. Named instance (connect by computer name + instance name). Add an allow incoming rule on UDP port 1434 to access to the SQL Browser service. Add an allow incoming rule on the database engine service.





            This procedure is fully documented here, or you can watch me explain and then walk through the configuration for a named instance here.






            share|improve this answer




























              17












              17








              17







              There are two levels of security that need to be changed in order to allow remote access.




              1. SQL Server configuration. By default in Express, Developer, and Enteprise Evaluation editions, connecting by the TCP/IP protocol is disabled. Enable this using SQL Server Configuration Manager.



              2. Windows Firewall. While disabling the firewall entirely will work for this component, doing so is not a security best-practice (nor is it required). (Note: in this section, I assume a default configuration. There are many settings that can be changed which affect these steps slightly.)



                There are two cases depending on the type of SQL Server instance you're connecting to:




                1. Default instance (connect by computer name only). Add an allow incoming rule either on TCP port 1433 or the database engine service.


                2. Named instance (connect by computer name + instance name). Add an allow incoming rule on UDP port 1434 to access to the SQL Browser service. Add an allow incoming rule on the database engine service.





              This procedure is fully documented here, or you can watch me explain and then walk through the configuration for a named instance here.






              share|improve this answer















              There are two levels of security that need to be changed in order to allow remote access.




              1. SQL Server configuration. By default in Express, Developer, and Enteprise Evaluation editions, connecting by the TCP/IP protocol is disabled. Enable this using SQL Server Configuration Manager.



              2. Windows Firewall. While disabling the firewall entirely will work for this component, doing so is not a security best-practice (nor is it required). (Note: in this section, I assume a default configuration. There are many settings that can be changed which affect these steps slightly.)



                There are two cases depending on the type of SQL Server instance you're connecting to:




                1. Default instance (connect by computer name only). Add an allow incoming rule either on TCP port 1433 or the database engine service.


                2. Named instance (connect by computer name + instance name). Add an allow incoming rule on UDP port 1434 to access to the SQL Browser service. Add an allow incoming rule on the database engine service.





              This procedure is fully documented here, or you can watch me explain and then walk through the configuration for a named instance here.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Sep 19 '13 at 2:26

























              answered Sep 6 '13 at 17:31









              Jon SeigelJon Seigel

              15.5k53573




              15.5k53573

























                  0














                  You have to set the correct Network-Settings in your SQL-Server:
                  Active TCP/IP in SQL-Server
                  Also be sure, that your Server Browser-Service is running, because if it is stopped, you can't access the SQL-Server.






                  share|improve this answer




























                    0














                    You have to set the correct Network-Settings in your SQL-Server:
                    Active TCP/IP in SQL-Server
                    Also be sure, that your Server Browser-Service is running, because if it is stopped, you can't access the SQL-Server.






                    share|improve this answer


























                      0












                      0








                      0







                      You have to set the correct Network-Settings in your SQL-Server:
                      Active TCP/IP in SQL-Server
                      Also be sure, that your Server Browser-Service is running, because if it is stopped, you can't access the SQL-Server.






                      share|improve this answer













                      You have to set the correct Network-Settings in your SQL-Server:
                      Active TCP/IP in SQL-Server
                      Also be sure, that your Server Browser-Service is running, because if it is stopped, you can't access the SQL-Server.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Aug 24 '13 at 10:23









                      BendEgBendEg

                      1012




                      1012























                          0














                          Be sure sqlbrowser service is turned on as mentioned by bendeg, and that UDP 1434 is open on your machine so clients can hit the sqlbrowser in order to resolve the name. Also open the named instance's TCP/IP port.



                          To find your instance's port, connect using the tcp: prefix in Management Studio like so: tcp:ASHISHPC1SQLEXPRESS and the result of the query below should be the port you need to expose to the clients in your workgroup.



                          SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID





                          share|improve this answer




























                            0














                            Be sure sqlbrowser service is turned on as mentioned by bendeg, and that UDP 1434 is open on your machine so clients can hit the sqlbrowser in order to resolve the name. Also open the named instance's TCP/IP port.



                            To find your instance's port, connect using the tcp: prefix in Management Studio like so: tcp:ASHISHPC1SQLEXPRESS and the result of the query below should be the port you need to expose to the clients in your workgroup.



                            SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID





                            share|improve this answer


























                              0












                              0








                              0







                              Be sure sqlbrowser service is turned on as mentioned by bendeg, and that UDP 1434 is open on your machine so clients can hit the sqlbrowser in order to resolve the name. Also open the named instance's TCP/IP port.



                              To find your instance's port, connect using the tcp: prefix in Management Studio like so: tcp:ASHISHPC1SQLEXPRESS and the result of the query below should be the port you need to expose to the clients in your workgroup.



                              SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID





                              share|improve this answer













                              Be sure sqlbrowser service is turned on as mentioned by bendeg, and that UDP 1434 is open on your machine so clients can hit the sqlbrowser in order to resolve the name. Also open the named instance's TCP/IP port.



                              To find your instance's port, connect using the tcp: prefix in Management Studio like so: tcp:ASHISHPC1SQLEXPRESS and the result of the query below should be the port you need to expose to the clients in your workgroup.



                              SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Aug 25 '13 at 0:12









                              Robert GannonRobert Gannon

                              349210




                              349210























                                  -1














                                  I turned the windows firewall off for Home Network and it worked fine.. Thank you all.. :)






                                  share|improve this answer



















                                  • 5





                                    If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

                                    – jcolebrand
                                    Aug 27 '13 at 19:28
















                                  -1














                                  I turned the windows firewall off for Home Network and it worked fine.. Thank you all.. :)






                                  share|improve this answer



















                                  • 5





                                    If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

                                    – jcolebrand
                                    Aug 27 '13 at 19:28














                                  -1












                                  -1








                                  -1







                                  I turned the windows firewall off for Home Network and it worked fine.. Thank you all.. :)






                                  share|improve this answer













                                  I turned the windows firewall off for Home Network and it worked fine.. Thank you all.. :)







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Aug 27 '13 at 17:56









                                  user27553user27553

                                  1




                                  1








                                  • 5





                                    If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

                                    – jcolebrand
                                    Aug 27 '13 at 19:28














                                  • 5





                                    If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

                                    – jcolebrand
                                    Aug 27 '13 at 19:28








                                  5




                                  5





                                  If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

                                  – jcolebrand
                                  Aug 27 '13 at 19:28





                                  If this was your question you should sign in here with the same credentials you used on the original site(Stack Overflow) so that you gain ownership of the question here.

                                  – jcolebrand
                                  Aug 27 '13 at 19:28











                                  -1














                                  Your SQL server must allow TCP/IP connections and you Windows Firewall must be turned off for Home Network.
                                  http://learnadvancecsharp.blogspot.in/2013/09/how-to-access-sql-server-database-from.html






                                  share|improve this answer




























                                    -1














                                    Your SQL server must allow TCP/IP connections and you Windows Firewall must be turned off for Home Network.
                                    http://learnadvancecsharp.blogspot.in/2013/09/how-to-access-sql-server-database-from.html






                                    share|improve this answer


























                                      -1












                                      -1








                                      -1







                                      Your SQL server must allow TCP/IP connections and you Windows Firewall must be turned off for Home Network.
                                      http://learnadvancecsharp.blogspot.in/2013/09/how-to-access-sql-server-database-from.html






                                      share|improve this answer













                                      Your SQL server must allow TCP/IP connections and you Windows Firewall must be turned off for Home Network.
                                      http://learnadvancecsharp.blogspot.in/2013/09/how-to-access-sql-server-database-from.html







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Sep 6 '13 at 10:07









                                      user27721user27721

                                      1




                                      1















                                          Popular posts from this blog

                                          Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

                                          How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

                                          Tecnologías entrañables Índice Antecedentes Desarrollo Tecnologías Entrañables en la...