This is my web.config
<connectionStrings>
<add name="SocialNetworkConnection" connectionString="Data Source='MySQL Database (MySQL Data Provider)';Initial Catalog=socialnet;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="socialnetConnectionString" connectionString="server=localhost;user id=root;password=Decewber@25!12;persistsecurityinfo=True;database=socialnet"
providerName="MySql.Data.MySqlClient" />
</connectionStrings>
This is my connection
str = ConfigurationManager.ConnectionStrings["socialnetConnectionString"].ConnectionString;
myConnection = new SqlConnection(str);
myConnection.Open();
But it shows an error:
System.Data.SqlClient.SqlException (0x80131904): 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: 26 Error Locating Server/Instance Specified)
Can you help me?
User contributions licensed under CC BY-SA 3.0