Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8043025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:46:41+00:00 2026-06-05T04:46:41+00:00

I have followed a microsoft video trying to make the single page application and

  • 0

I have followed a microsoft video trying to make the single page application and it doesnt create or connect to my sql instance even though I have other applications using code first. For example the connection string was…

<add name="DefaultConnection" connectionString="Data Source=Localhost;Initial Catalog=aspnet-MvcApplication2-201265113324;Integrated Security=True" providerName="System.Data.SqlClient" />

But I get an error saying

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)

Its really strange because my other application with the connectionstring…

<add name="PteDotNetContext" providerName="System.Data.SqlClient" connectionString="Server=Localhost;Database=PteDotNet;Trusted_Connection=true;" />

Works fine and will connect no problem…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:46:42+00:00Added an answer on June 5, 2026 at 4:46 am

    If you do not provide a connection string or connection string name to the DbContext constructor, it will try to find a connection name that matches the (inherited) DbContext class name.

    Hence you can either change the name of the connection string

    <add name="MyDbContext" connectionString="Data Source=Localhost;Initial Catalog=aspnet-MvcApplication2-201265113324;Integrated Security=True" providerName="System.Data.SqlClient" />
    

    Or provide the name of the connection string in the constructor

    public class MyDbContext : DbContext
    {
         public MyDbContext() : base("DefaultConnection") {}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed this tutorial to create the first azure application http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_IntroToWindowsAzureLabVS2010 Because after
I have scenario where thread updates form's control. I followed http://msdn.microsoft.com/en-us/library/ms171728.aspx to make it
I have an ASP application trying to access a database in SQL Server 2008.
I have followed all the steps correctly present in http://msdn.microsoft.com/en-us/library/gg492140.aspx I am trying to
Hi have followed this tutorial using Core plot framework http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application My project compiles, but
I have followed his popular tutorial to connect Android to MySQL: http://www.helloandroid.com/tutorials/connecting-mysql-database It is
I have followed this tutorial which allowed me to create a Silverlight DataGrid that
Any body have any luck with ShellTileSchedule? I have followed the Microsoft example and
I am doing the walkthrough in the following link: http://msdn.microsoft.com/en-us/library/zt39148a%28VS.80%29.aspx I have followed it
I am developing Windows Form Application using Microsoft Visual C# 2010 I have two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.