PDA

View Full Version : سوال: کمک فوری Login failed for user



30yamand
پنج شنبه 20 شهریور 1393, 20:37 عصر
سلام خدمت اساتید گیر کردم نمیدونم چطور خلاص شم .برنامم این خطا رو میده ببینمکسی میتونه کمک کنه.

Login failed for user 'Amir-PC\Amir'.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the application's App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:



If the application is running on either Windows 7 or Windows Server 2008R2, special configuration steps are necessary to enable automatic creation of the provider database. Additional information is available at: http://go.microsoft.com/fwlink/?LinkId=160102. If the application's App_Data directory does not already exist, the web server account must have read and write access to the application's directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the application's App_Data directory already exists, the web server account only requires read and write access to the application's App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the application's App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server account's credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.

30yamand
پنج شنبه 20 شهریور 1393, 20:43 عصر
اینم فایل web.config من


<configuration> <connectionStrings>
<add name="ParandDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=ParandDB;Integrated Security=true;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<anonymousIdentification enabled="true"/>
<profile enabled="true">
<properties>
<add name="MemberName"/>
<add name="Name"/>
<add name="Address"/>
<add name="City"/>
<add name="Country"/>
<add name="Mailing" type='System.Boolean'/>
<add name="Email"/>
<add name="Theme"/>
<add name="Cart" serializeAs="Binary" type="Parand.Commerce.ShoppingCart" allowAnonymous="true"/>
</properties>
</profile>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
</system.web>
</configuration>

mohammad reza beizavi
پنج شنبه 20 شهریور 1393, 21:09 عصر
درود
از توی وب کانفیگ این رو بردار:
<anonymousIdentification enabled="true"/>
<profile enabled="true">
<properties>
<add name="MemberName"/>
<add name="Name"/>
<add name="Address"/>
<add name="City"/>
<add name="Country"/>
<add name="Mailing" type='System.Boolean'/>
<add name="Email"/>
<add name="Theme"/>
<add name="Cart" serializeAs="Binary" type="Parand.Commerce.ShoppingCart" allowAnonymous="true"/>
</properties>
</profile>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>



بعد این رو جایگزین کن، ببین اکی میشه؟
<roleManager enabled="true">
<providers>
<clear />
<add name="AspNetSqlRoleProvider"
connectionStringName="ParandDBConnectionString"
applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>

30yamand
پنج شنبه 20 شهریور 1393, 22:01 عصر
دوست عزیز من از این قسمت profile برای سبد خریدم ازش تو برنامم استفاده کردم نمیشه حذفش کنم .

30yamand
پنج شنبه 20 شهریور 1393, 22:26 عصر
دوست عزیز ربطی به این فایل داشته باشه من وقتی میخوام فایل Database.mdf رو به پوشه ap_data اضافه کنم اررور Login failed for user Amir-PC\Amir رو میده

30yamand
جمعه 21 شهریور 1393, 15:43 عصر
افایون کسی نبود کمکمون کنه