VB.Net Connection string over draytek tunneling vpn - string

I am doing a VB.NET application, using SQL server as my database. SQL sever is located on other network connected via draytek VPN Matcher, Can you please recommend, what is the best connection string to connect to SQL Server from windows form application using oledb
Thanks to all
I tried using the IP directly with port 1433. I could connect through SSMS but not by the VB.Net application. I tried the SSMS it connects, but my appliction do not connect. It gives Error, server is not available any more.

Related

how to open Azure SQL SERVER in office network, I am able to open AZure SQL Using my Home network in SSMS but cant open in Office network

I am not able to open Azure SQl Server in my Office network using SSMS
I can open Azure SQl SERVER using my home network from SSMS.
Please help me how can I configure Azure SQL SERVER in office network and work using SSMS.
Thanks
The error usually means the TCP port is not properly set or is being blocked by the firewall.
To access the Azure SQL database from your local, ensure that the firewall on your network and local computer allows outgoing communication on TCP port 1433.
There are some troubleshooting steps provided in detail in this MS document for the same error message.

What is the SQL Server connection string in c# application for client computers

I am unable to access database using c# application from all client computers in the same network but main computer sql server worked fine. Note: all settings like TCP/IP ping, firewall, .net installed is set already. Is there any good code to establish connection or connection string?
Code to establish connection or connection string accessible through other computer without sql server installation

How to connect to Azure Database for PostgreSQL flexible server from azure data studio

I'm using Azure Database for PostgreSQL flexible server in my azure account. I'm not able to connect to this server from azure data studio, getting the below error...I have already installed the Postgres extension in the azure studio. Thanks in advance.
could not connect to server: Connection refused (0x0000274D/10061) Is
the server running on host
"https://test-postgres.postgres.database.azure.com" (x.x.x.x) and
accepting TCP/IP connections on port 5432?
This is more than likely to do with your company's firewall blocking port 5432.
Flexible server can be stopped and started on demand. Ensure the database is running from the Azure Portal.
Also check the firewall settings for the database in the portal. By default databases will have all IP addresses blocked for connections. Add the public IP of the computer you are connecting Data Studio from.
If it is running, and firewall is open, it is likely a network firewall issue. You can test this by connecting to the database through your bash prompt in Azure Portal, or by connecting to an Azure VM to test with.

Azure hybrid connection Manager does not work

Requirement
I have an On-Premise SQL Server and an Azure webApp Service that needs to talk each other. I installed Hybrid Connection Manager on another computer which is in the same LAN as the SQL server. Let's refer this computer as the Connection PC.
The working part
Installation and configuration was straight forward, status of the hybrid connection showing as connected.
Tested the WebApp on localhost, it worked fine. Which means nothing wrong with the asp.net code
SSMS on the connection PC can access and query SQL DB
I installed a test SQL DB on the connection PC itself and use the WebApp to talk to the test DB instead, It worked fine.
The Problem
After tested ok on localhost, I published ASP.Net WebApp to Azure, it gave following 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
troubleshoot attempt
Does that mean Hybrid Connection manager has to be installed on the same computer that runs SQL Server?
I did attempt to install HCM on the SQL Server, but it says it cannot work with Win2008R2. The connection PC has win2012 on it. So it can have HCM.
I just do not have time to migrate the SQL Server to another server. So I hope HCM does not have to be on SQL server.
Connection String
In my webapp, the connection string is as follows.
connectionString="metadata=res:///ScaleDataModel.csdl|res:///ScaleDataModel.ssdl|res://*/ScaleDataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=WIN2008R2\DataPlus;initial catalog=DataPlus;persist security info=True;user id=test;password=testpass;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"
Hybrid Connection communicates via TCP ports thus you need to specify the listening static port in your connection string like:
Data source=ServerName:Port;
Also here is an actually detailed article about the all problems you may encounter while working with Hybrid Connections.
Hope this helped you.
Since you have a hybrid connection, your connection string should have the endpoint name of your hybrid connection as the data source. Try replacing it.

Connecting ASP on Azure Virtual Machine to Azure Db

Has anyone ever connected ASP (ASP, aka classic not .NET) to an Azure db? I've had three experts looks at connection strings, endpoints, firewalls, db accounts and they're finding
the database works and contains data
the database is accessible remotely by our local machines via Visual Studio and SQL Server Manager
ASP runs on web server on the VM machine
All the connection strings offered by Azure fail
All db related ports are open
If you're connecting to the Azure DB from SSMS, everything is probably configured properly.
Which client library are you using to connect to the Azure SQL instance? You may need to download and install the MS SQL Native Client on the VM, which I know works.
Are you using ADO in your app? If so, and assuming you have installed the Native Client, this connection string will work:
Driver={SQL Server Native Client 10.0};Server=tcp:[serverName].database.windows.net; Database=myDataBase;Uid=[LoginForDb]#[serverName];Pwd=myPassword;Encrypt=yes;

Resources