Error 26: issues connecting app with database

griselda rios 6 Reputation points
2021-01-26T03:30:15.23+00:00

Hello, I'm getting error 26 when my app needs to connet to the database. My app is up in Azure, as well as my database. Query in my database runs fine.

My app is in ASP.NET VB.NET and the database is in SQL server.

Azure has no problem showing websites .aspx. The problem appears when you click on a button which leads to connection with the database.

How do I connect my app with my database?

Thanks for your help.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,542 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,756 questions
{count} votes

3 answers

Sort by: Most helpful
  1. griselda rios 6 Reputation points
    2021-01-29T16:02:41.767+00:00

    For anyone having my same problem, I've found the solution.

    The problem was that my vb code had the connection string. So, it was useless to change the connection string only in the web.config file.

    So, in my vb code I wrote a reference to my connection string, via the name of it.

    Then, when the app was in Azure, I changed the connection string in the web.config.

    And it worked ;)

    1 person found this answer helpful.
    0 comments No comments

  2. mrharry15 1 Reputation point
    2021-02-19T05:15:43.27+00:00

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. ... May be server is stopped, you don't have permission to access the server, or the instance name is not correct . Verify that the instance name is correct and that SQL Server is configured to allow remote connections. visit


  3. Duane Arnold 3,216 Reputation points
    2021-02-19T07:38:56.343+00:00

    Your solution makes no sense. Azure is a Web server platform that means that multiple users trying use the program out there on the Azure platform, the program is going to blow up, becuase the MS SQL Server Express MDF file, which I think you are using, is being used in a single user access fashion , and only one user at any given time can have the MDF file open.

    If you have not had the database file attached to a Azure MS SQL Server database engine so that the database can be used concurrently by multiple users using your ASP.NET Web program, then what you have done is not viable if more than one user tries to use your ASP.NET Web program concurrently.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.