cannot access my SQL server from my application
I installed my SQLserver and fixed an IP address and i can't access my server from a different computer which is in the same network with the server. i can ping my server and from my server i can ping my computer where my app is installed.
when i put my connectionstring from my app i get an error saying:
Quote:
A network-related or instance-specific error occurred while establishing a SQL server connection. The server cannot be found or is not accessible. Verify that the instance name is correct and that SQL server is configured to allow remote connections-Error 26
Here is my connectionstring:
Code:
MyConnexion = New SqlConnection("Data Source=192.168.1.2;Initial Catalog=Gestock;Integrated Security=True")
Re: cannot access my SQL server from my application
You have to allow remote connections to that SQL instance. By default remote connections are turned off.
What version of MS SQL are you running?
Re: cannot access my SQL server from my application
Can you tell me how to proceed please? Am new with SQL server. Am using SQL server 2014 express
Re: cannot access my SQL server from my application
This link should help
https://www.top-password.com/blog/ho...in-sql-server/
If you have problems use Google and find a better link.
I googled for this: sql server 2014 allow remote connections
Re: cannot access my SQL server from my application
I tried all you did and even created a user account but still nothing , tried to chande the sa password and logged in with sa still not working.
This is my error
Quote:
Connection failed. The connection comes from an untrusted domain and can not be used with Windows Authentification
Re: cannot access my SQL server from my application
I can see the error has changed. No longer can the server NOT BE FOUND. Now it simply dislikes the way you are trying to authenticate.
Are you on a DOMAIN here - a real NAMED domain? How is the network setup?
Re: cannot access my SQL server from my application
Quote:
Originally Posted by
okouele21
I tried all you did and even created a user account but still nothing , tried to chande the sa password and logged in with sa still not working.
This is my error
You say that you tried to log in as 'sa' but the error message indicates that you were using integrated security. Integrated security means that you are logging in as the current Windows user. If you want to provide a SQL Server login and password then you have to specify that you're NOT using integrated security. I suggest reviewing what SQL Server connection strings should look like for various scenarios.
https://www.connectionstrings.com/sql-server/
That same site has an explanation for every supported keyword in a SqlConnection connection string.
https://www.connectionstrings.com/al...ring-keywords/
Re: cannot access my SQL server from my application
I am a big fan of using SQL authentication due to simplicity and basically thats how my clients do it too, ive just spent a short while looking into windows authentication as it seems to be a more secure option but i cannot find any clear instructions on how exactly you would set that up on an sql server ........
is seems like its based on workgroups and domains which seems a little restricted, is this option only meant to be used for internal operations/connections so to speak?
this is one of the links i was looking at which gave a very simple step by step process LINK, but with my limited knowledge of this kind aof authentication it just doesnt make sense.......
I might bring up another suggestion to the OP, try using SQL authentication, its very simple and setting up users for this is very straight forward using mssql server management studio or a similar tool.........
maybe someone can clarify a little more on the best scenarios for using windows authentication and how the OP might set it up properly...
Re: cannot access my SQL server from my application
Quote:
Originally Posted by
GBeats
is seems like its based on workgroups and domains which seems a little restricted, is this option only meant to be used for internal operations/connections so to speak?
It is based on domains/workgroups, because that is the only way that the Windows login details can be safely verified.
Connections outside of a domain/workgroup would require something roughly equivalent to SQL Server Authentication, and as that is useful to have anyway it makes sense to require it in those circumstances (rather than create and maintain an alternative method).
Re: cannot access my SQL server from my application
Quote:
Originally Posted by
okouele21
Can you tell me how to proceed please? Am new with SQL server. Am using SQL server 2014 express
I'm highlighting that last bit there because it seems to have been glossed over by the others. Given your newness to SQL Server, I'm guessing you accepted the defaults for everything - INCLUDING THE INSTANCE name..... which means you need to tack on /SQLEXPRESS to the end of your IP address in the connection string. When installing SQL Server, you can give it an instance name. This allows you to have multiple versions of different or the same SQL Server running on your system. At one point, I had SQL Server 2008 (my default), 2012 (as SQLServer2012) and 2014 (as SQLServer2014) all on my system at the same time. They all run independently from each other, with their own settings, file system and databases. By default, when you install SQL Server Express, it creates an instance called "SQLEXPRESS"
So you connection string should be "...Data Source=192.168.1.2\SQLEXPRESS;Initia..."
Quote:
Originally Posted by
GBeats
I am a big fan of using SQL authentication due to simplicity and basically thats how my clients do it too, ive just spent a short while looking into windows authentication as it seems to be a more secure option but i cannot find any clear instructions on how exactly you would set that up on an sql server ........
is seems like its based on workgroups and domains which seems a little restricted, is this option only meant to be used for internal operations/connections so to speak?
this is one of the links i was looking at which gave a very simple step by step process
LINK, but with my limited knowledge of this kind aof authentication it just doesnt make sense.......
I might bring up another suggestion to the OP, try using SQL authentication, its very simple and setting up users for this is very straight forward using mssql server management studio or a similar tool.........
maybe someone can clarify a little more on the best scenarios for using windows authentication and how the OP might set it up properly...
As far as I know the Authentication method for SQL Server can only be set during installation and can't be changed afterwards... but I could be wrong about that. I've always selected "Mixed" mode during installation so as to have the ability to do either when I need to.
-tg
Re: cannot access my SQL server from my application
Quote:
Originally Posted by
techgnome
As far as I know the Authentication method for SQL Server can only be set during installation and can't be changed afterwards... but I could be wrong about that. I've always selected "Mixed" mode during installation so as to have the ability to do either when I need to.
-tg
You can change the setting after install - just need to restart the service.
If SQL Authentication can be avoided it should. Windows / AD authentication is preferred for a variety of reasons.
Re: cannot access my SQL server from my application
Quote:
If SQL Authentication can be avoided it should. Windows / AD authentication is preferred for a variety of reasons.
I agree with this and maybe take it a bit further and say integrated security is a large reason if not the only reason to use MSSQL over other options.