problem occurred while establishing a connection to SQL Server
-
yes
What type of application did you connect with SQL Server? ASP.NET or Windows application? What type of authentication are you using to connect?
-
yes
Is your connection string correct? Post it
Coding C# ExciteTemplate
-
What type of application did you connect with SQL Server? ASP.NET or Windows application? What type of authentication are you using to connect?
Asp.net and im using mixed mode my code string m = "Data Source=./SQLEXPRESS;AttachDbFilename=C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/TestData.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; SqlConnection mycon = new SqlConnection(m); mycon.open();
-
Asp.net and im using mixed mode my code string m = "Data Source=./SQLEXPRESS;AttachDbFilename=C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/TestData.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; SqlConnection mycon = new SqlConnection(m); mycon.open();
http://www.connectionstrings.com/ This shall help you!!
Coding C# ExciteTemplate
-
Is your connection string correct? Post it
Coding C# ExciteTemplate
what is wrong with my connecting string????
-
Asp.net and im using mixed mode my code string m = "Data Source=./SQLEXPRESS;AttachDbFilename=C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/TestData.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; SqlConnection mycon = new SqlConnection(m); mycon.open();
You are missing DATABASE name in connection string.
Coding C# ExciteTemplate
-
what is wrong with my connecting string????
Check the above reply.
Coding C# ExciteTemplate
-
Check the above reply.
Coding C# ExciteTemplate
i add database name but it give me the same result :sigh: what is ment by Verify that the instance name is correct ?????
-
i add database name but it give me the same result :sigh: what is ment by Verify that the instance name is correct ?????
Data Source=./SQLEXPRESS ./SQLEXPRESS This is instance name. Check in your management studio if this is correct. HTH
Coding C# ExciteTemplate
-
Asp.net and im using mixed mode my code string m = "Data Source=./SQLEXPRESS;AttachDbFilename=C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/TestData.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; SqlConnection mycon = new SqlConnection(m); mycon.open();
So you are using Windows Authentication. ASP.NET application will be running under ASPNET account if you open your site from local IIS. Therefore the ASPNET may not have access to the database. Try to use SQL authentication. Also the database path should look like C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TestData.mdf. I am not sure ADO.NET will accept / in a path specification.
-
hi every body im having a big problem. icant connect to my data base. i have this 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) i dont know what to do please help me
just do the following steps goto StartMenu ---->SqlServer----->Configuration Tools-------->SQL Server Configuration Manager and check in NAMED PIPES protocol is enabled or not :)
Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it
-
just do the following steps goto StartMenu ---->SqlServer----->Configuration Tools-------->SQL Server Configuration Manager and check in NAMED PIPES protocol is enabled or not :)
Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it
i enabled it and it suggest to restart sql what to do next????
-
i enabled it and it suggest to restart sql what to do next????
Restart your pc or restart the SQL services. Control Panel > Administrative Tools > Services
Coding C# ExciteTemplate
-
Restart your pc or restart the SQL services. Control Panel > Administrative Tools > Services
Coding C# ExciteTemplate
ops it didnt work ido all thing but the same problem occured
-
ops it didnt work ido all thing but the same problem occured
Have you enabled Client Protocol > Named Pipes ?
Coding C# ExciteTemplate
-
hi every body im having a big problem. icant connect to my data base. i have this 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) i dont know what to do please help me
Do you trying to connect SQL Server via a proxy server... please let me know.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. Thanks Md. Marufuzzaman
-
i enabled it and it suggest to restart sql what to do next????
nothing else if you are connecting through Named Pipes then you should enable Named Pipes and if you are connecting through TCP/IP then you should enable your tcp/ip protocol , make sure your SQL Browser is also started....
Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it
-
Restart your pc or restart the SQL services. Control Panel > Administrative Tools > Services
Coding C# ExciteTemplate
-
services can be restarted by right clicking your sql server in Management studio and clicking on restart or from windows services (typing services.msc in run will open)
Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it
sorry for being late.......please tell me how to enable sql browser
-
sorry for being late.......please tell me how to enable sql browser