PDA

View Full Version : سوال: مشکل در آدرس Connection String



ghodsana
چهارشنبه 17 دی 1393, 08:21 صبح
بسم الله
سلام
من از کنترل CreateUserWizard برای ثبت نام کاربر در پروژه م استفاده کردم
هنگامی که مشخصات کاربر جدید رو در فرم وارد می کنم و روی دکمه ی Create User کلیک میکنم با این خطا مواجه میشم :


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)


کد Web.config هم این هستش :


<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrame workSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="newsdbConnectionString"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirec tory|\newsdb.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />
</system.web>

<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectio nFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>


کجای این کد مشکل داره ؟

من از Visual Studio 2013 و برای بانکم از Sql Server Express استفاده می کنم
Sql Serever 2014 هم روی سیستمم نصب هستش

notlikeothers
چهارشنبه 17 دی 1393, 19:54 عصر
سلام.تو vsقسمت server explorer دیتا بیست رو اد کن یه پروپرتی بگیر ازش قسمت کانکشن استرینگ رو کپی کن تو web config.فک کنم درست شه