4
I need to connect to an SQL Server service on a remote server via Sqlconnection, C#. Initially, it was not possible to find the server, but I solved this by modifying the hosts file of system32, enabling exception in the server firewall and enabling SQL Server Browser. However, now he gives me an exception saying "The waiting time limit has been reached" when trying to open connection to the bank. What should I do?
Here is an example of the Connection string I’m using: "Data Source=xxx.xxx.xxx.xxx/MSSQLSERVER, 1433;Database=meuBanco;User Id=sa;Password = ************;"
On my web. Conf I use so:
<add name="cepConnectionString" connectionString="Password=senha;Persist Security Info=True;Connect Timeout=450;User ID=usuario;Initial Catalog=banco;Data Source=servidor" providerName="System.Data.SqlClient" />
. A question you enabled your bank to client?– Marconi
You say enable remote connection on SQL server?
– Davi GN
This in the database installed on the server.
– Marconi
Yes, I enabled in SQL Server, puis exception in firewall and enabled sql server browser. But it was giving that exceeded the time limit
– Davi GN
You gave IIS permission to access the bank?
– Marconi
What do you mean? I’m wanting to access SQL from a Windows Forms application, IIS interferes?
– Davi GN
No, I thought it was Web. Guy is hard to know what it can be. Have you entered the mangament studio to know if it’s happening? Have you tried using my Connectionstring I posted?
– Marconi
Then, by management studio I opened the server properties and enabled remote connection. In SQL Server Configuration manager I enabled sql server browser and configured TCP/IP. When I put mine
– Davi GN
Something’s missing. But you’re on the right track.
– Marconi
Any more ideas than I can try?
– Davi GN
You have enabled the services?
– Marconi
Yes. SQL Server, Sql Server Browsere Network Browsers are all enabled
– Davi GN
You can access the bank using the Management Studio (SSMS)?
– Randrade