Question connection string over internet

SasaYamaoka

New member
Joined
Apr 4, 2015
Messages
2
Programming Experience
Beginner
Hi,

i am trying to learn C# programing language, so far i am an absolute beginner. I find visual studio and C# to be a fantastic tool.

I am trying to make a very simple windows form application that would connect to SQL server over internet with which a user could add or change data in the database. I made a simple web form and connected it to SQL to a specific table. I enabled in SQL server configuration management TCP/IP and added 1433 to ports. Disabled windows firewall, made changes in router for forwarding to 1433 and made static IP address.

I tested if i could connect SQL server from laptop to my PC over IP address and it works. But when i try to use the app it always says that there is an login error and thaht the domain is untrusted.

This is my connection string (IP is that of router):

<add name="SQLconnString"
connectionString="Data Source=xxx.xxx.x.x\SQLBUTINA,1433;Network Library=DBMSSOCN;Initial Catalog=KTRaspremanjeTEST_V5;User ID=Korisnik;timeout=6000"
providerName="System.Data.SqlClient" />

What am i doung wrong?
Thank you !!!!!!!!!!
Sasa
 
The password is not included in that connection string. Have you removed it before posting here or did VS do that as a security measure? If the password is really not there in the connection string then that would explain why it can't connect.
 
APP error.jpg

Hi Jim,

i did remove it before posting, in that time i was trying to see if maybe the password was part of the problem. This is my string in its entirety:

<connectionStrings>
<add name="SQLconnString"
connectionString="Data Source=xxx.xxx.x.x\SQLBUTINA,1433;Network Library=DBMSSOCN;Initial Catalog=KTRaspremanjeTEST_V5;User ID=Korisnik;Password=123456;timeout=6000"
providerName="System.Data.SqlClient" />
</connectionStrings>

It does not work with password either (printscreen is of app on host laptop pc).
 
Last edited:

Latest posts

Back
Top Bottom