简体   繁体   中英

Web app works fine with local host; won't connect to hosted SQL server

I can connect and retrieve data from a localhost database. My app retrieves the data from a hosted sql server using the following connection string

<add name="conn" connectionString="Data Source=xxx.xxx.xx;Initial  
     Catalog=xxxx;Persist Security Info=True;User ID=xxxx;Password=xxxx"     
     providerName="System.Data.SqlClient"/>

Is there anyway I can connect to this database without uploading it to the third party service?

Test your Hosting provider by using SQL Management studio, in studio; use the full host name and a comma for the alternate port number. The default port number is 1433 for SQL Server.

After getting the connection working in studio, configure your connection string within your program.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM