PDA

View Full Version : سوال: مشکل Runtime Error بعد از اپلود روی هاست



farshadvl
یک شنبه 15 شهریور 1388, 19:39 عصر
با سلام
من یه سایت طراحی کردم و دیتابیس هم داره
یک هاست ویندوز هم خریدم که اسکریپت asp‎.Net اونو هم فعال کردم. صفحه اول سایت از دیتابیسم اطلاعاتو میخونه و یک صفحه ارور هم قرار دادم که وقتی صفحه اول را درخواست میدم ارور زیر را می دهد ولی وقتی نام صفحه ارور را تایپ میکنم اون صفحه را بدون مشکل لود میکنه.
کسی میدونه مشکلم از کجاست؟



Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>


</configuration>

این هم تنظیمات Web.config:


<?xml version="1.0"?>

<configuration>
<appSettings/>
<connectionStrings>
<add name="Mydata" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Test.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="~/errorpage.aspx"/>
</customErrors>

<compilation debug="true"/>

<authentication mode="Forms"/>
</system.web>
</configuration>

farshadvl
دوشنبه 16 شهریور 1388, 00:14 صبح
کسی نمیدونه؟ تورو خدا کمکم کنید این سایتو فردا باید روی هاست بریزم و تحویل بدم
:گریه::گریه::گریه::گریه::گریه:

naser2009
دوشنبه 16 شهریور 1388, 01:02 صبح
منم مشکلم همینه کمک کمک کمک کمک کمک:گریه::گریه::گریه::گریه:

farshadvl
سه شنبه 17 شهریور 1388, 12:38 عصر
چقدر راهنمایی کردید

miandej
شنبه 04 مهر 1388, 15:51 عصر
manam daghighan in moshkelo daram.mikham bedonam be barname rabt dare ya be server

Saber_Fatholahi
شنبه 04 مهر 1388, 16:38 عصر
دوست من خطا از COnnection String شماست
اونو تغییر بدین
دیتابیس اتچ کنین روی سرور
برای مشاهده خطا هم مد خطارو off کنین

farshadvl
شنبه 04 مهر 1388, 17:35 عصر
دوست من خطا از COnnection String شماست
اونو تغییر بدین
دیتابیس اتچ کنین روی سرور
برای مشاهده خطا هم مد خطارو off کنین

با تشکر از راهنمایی شما دوست عزیز
من دیتابیس را درون پوشه App_Data قرار دادم و همون پوشه را مستقیما روی هاست آپلود کردم که اگر به کانکشن استرینگم نگاه کنید متوجه میشوید چگونه کار میکنه .
مشکل من از کجاست ؟

Himalaya
شنبه 04 مهر 1388, 23:14 عصر
تو web.config و در قسمت

<customErrors mode="RemoteOnly">
به جای RemoteOnly باید Off بزاری تا تازه بتونی متن خطای اصلی رو ببینی...به بزرگ و کوچیک بودن حروف Off دقت کن...این کارو بکن تا ببینیم خطا از چیه

farshadvl
یک شنبه 05 مهر 1388, 10:05 صبح
من کاری که گفتید را انجام دادم این ارور را میده :



Server Error in '/' Application.

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)

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.

Exception Details: System.Data.SqlClient.SqlException: 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 من اگر ممکنه اونو تصحیح بفرمایید

در ضمن روی هاست سیستم هاست کنترلر هست که واسه تعریف ئیتابیس فقط میتوان یک نام داد و یک دیتابیس ایجاد کرد و ریستور کرد

Saber_Fatholahi
یک شنبه 05 مهر 1388, 11:00 صبح
خوب پس حالا فهمیدی دوست من خطا از دیتا بیسه
این روشی که شما رفتی برای روی لوکاله
شما باید توی کنترل پنل هاستت یه دیتابیس ایجاد کنی
و دیتابیسی که خودت داری توی اس کیو ال خود بک اپ بگیری
بعد توی کنترل پنل هاستت اونو ری استور کنی
حالا باید توی کانکشن استرینگت مشخصات سرور و نام دیتابیس و ... بنویسی
مثلا

<add name="yourconnection string" connectionString="Data Source=mssql.yourdomain.com;Initial Catalog= PWSComputer ;User ID=user;Password=pass" providerName="System.Data.SqlClient"/>
موفق باشی

farshadvl
یک شنبه 05 مهر 1388, 16:50 عصر
<add name="yourconnection string" connectionString="Data Source=mssql.yourdomain.com;Initial Catalog= PWSComputer ;User ID=user;Password=pass" providerName="System.Data.SqlClient"/>موفق باشی[/quote]

با تشکر از راهنماییتان
حالا باید بجای mssql.yourdomain.com آی پی سایتو بزارم؟
در ضمن یوزر نیم و پسورد چیو باید در کانکشن استرینگ بزارم؟

daffy_duck376
یک شنبه 05 مهر 1388, 21:38 عصر
دوستان اگه میخواهید توی اتصال به دیتا بیس به مشکل نخورید توصیه میکنم از ODBC استفاده کنید چون بعد ساختن بانک روی هاست نام بانم ، نام کاربران عوض میشه و این همه چیز رو به هم میریزه