Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
error

ASM
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: SQL Network Interfaces, error: 25 - Connection string is not valid)


    <add name="const" connectionString="Data Source=66.155.58.218:8443;Initial Catalog=Db_col;User Id=sa;Password=puNeCollege02MH12;Integrated Security=True"
      providerName="System.Data.SqlClient" />
Posted
Updated 26-Jan-15 6:38am
v4
Comments
Marbulinek 26-Jan-15 8:31am    
try to ping IP of server.. is it responding?
Richard Deeming 26-Jan-15 13:00pm    
I hope that's not your real sa password that you've just posted to a public forum!

Contact your DBA and get them to change the sa password IMMEDIATELY. You should also get them to check that the server is locked down and SQL is not available across the Internet.

Also, your application shouldn't be connecting as sa; use a specific user with only the permissions required for your application to run.
Member 8893861 26-Jan-15 13:07pm    
yes i am getting longed in
by https://66.155.58.218:8443/
Member 8893861 26-Jan-15 13:10pm    
my DBA is not responding properly , he says now a days we can not log in from management studio
as there is no such data i am sharing my user credential

Make sure your Instance Name, User Name and password is connect. I would suggest to connect remote instance using Management studio and if it works then try these credentials in your project.
 
Share this answer
 
Comments
Member 8893861 26-Jan-15 12:06pm    
yes it is working in management studio
Please read this:
https://www.connectionstrings.com/sqlconnection/[^]
This page gives lots of examples how to build a proper connection string.

Your connection string does not make any sense.
 
Share this answer
 
v2
Use a connection class like-


C#
public SqlConnection dbConnect()
    {
        cnnStr = "Data Source = 10.168.2.32";
        cnnStr += "; Initial Catalog = DBNAME";
        cnnStr += "; Integrated Security = false";
        cnnStr += "; User ID = userid";
        cnnStr += "; Password = password";

        return new SqlConnection(cnnStr);
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900