الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف أحول إلى DSN Connection

بدأه إبراهيم دويكات في 20 فبراير 2007 · 11 رد · 2,463 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

أقوم بتصميم موقع على ASP.NET2005 باستخدام C#

قمت بعمل قاعدة بيانات على الـACCESS وقمت بربطها باستخدام AccessDataSource وبعد ذلك قمت باستخدامها في أشياء مختلفة وصفحات مختلفة فقد استخدمتها في GridView و DataList و Details View وقد كانت جملة الربط في Source واللتي يضيفها Visual Studio تلقائيا (في إحدى الصفحات)هكذا:

<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/gdata.mdb"
			OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [name], [city], [website], [adcomt], [comment], [email] FROM [users] WHERE ([prevent] = ?) ORDER BY [no] DESC">
			<SelectParameters>
				<asp:Parameter DefaultValue="false" Name="prevent" Type="Boolean" />
			</SelectParameters>
		</asp:AccessDataSource>

والموقع يعمل بالشكل المطلوب

المشكلة أنني عندما رفعت الموقع على Server ظهر لي أن هناك مشكلة

Server Error in '/' Application.

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>

بعد البحث والتمحيص والسؤال والاستفسار من مزود خدمة الاستضافة على Server تبين أن السيرفر يدعم خدمة DSN أي Database Source Name

حيث أنه يجب علي أن أضع قاعدة البيانات في مجلد خاص تم تحديده من المستضيف ويمكنني أن أتصل بقاعدة البيانات من أي مكان في الموقع

كيف يمكنني أن أحول Connection من DataFile إلى DSN؟؟؟؟؟

أرجو المساعدة في أقرب وقت لانني بحاجة ماسة لذلك ولكم كل الشكر والتقدير والاحترام

تم تعديل هذه المشاركة بواسطة إبراهيم دويكات في 20 فبراير 2007 في 17:55

My_Sign.jpg
#2

هل من حل؟؟؟ ؟؟ ؟

My_Sign.jpg
#3

عندك خطأ في البرنامج وعشان تعرف الخطأ

لازم تروح لملف web.config في المشروع وتغير الجملة <customErrors mode="Off"/>

بـ ( <customErrors mode="On"/>

وشوف الخطأ واحنا منتظرينك

#4

شكرا لردك أخ Scoool

أود لفت النظر إلى أمرين

أولهما أنني قمت بتصميم موقع بلغة ASP.NET2 ورفعه على السيرفر وهو يعمل بشكل طبيعي (بدون قاعدة بيانات)

الامر الاخر أن هذا الموقع (الذي يحتوي على قاعدة بيانات) يعمل بش عادي على جهازي (على IIS)

الان قمت بإضافة <customErrors mode="On"/>

وقد كان الخطأ كالتالي:

Server Error in '/' Application.

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>

My_Sign.jpg
#5

طبعا وببساطة قمت بتعديل الجملة إلى <customErrors mode="Off"/>

وكان الخطأ كالتالي:

Server Error in '/' Application.

onfiguration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 26: ASP.NET to identify an incoming user.

Line 27: -->

Line 28: <authentication mode="Windows"/>

Line 29: <!--

Line 30: The <customErrors> section enables configuration

أيضا قمت بتجربة تغيير الجملة الملونة بالاحمر إلى

<authentication mode="Forms"/>

ثم

<authentication mode="None"/>

ثم

<authentication mode="Passport"/>

ولكن دون فائدة........

مال الحل برأيكم؟؟؟؟

My_Sign.jpg
#6

أرجوكم، هل من مساعدة..... اقترب موعد تسليم الموقع......

My_Sign.jpg
#7

اعاني من نفس هذه المشكلة الان ولا ادري ما الحل ؟؟؟؟؟؟؟؟؟؟؟؟

logosite.gif
#8

اتمنى ان يتم مساعدتنا في حل هذه المشكلة ، حيث انني قمت بعمل موقع لتحميل وتنزيل الملفات (وهو مرفق مع الرد) ولكن تظهر رسالة الخطء التالية عند التنفيذ :

اقتباس
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 49: ASP.NET to identify an incoming user.

Line 50: -->

Line 51: <authentication mode="Windows"/>

Line 52: <customErrors mode="Off"/>

Line 53:

upload.rar

logosite.gif
#9

اخي الدويكات هناك طريقة من خلال الفيجيول ستوديو ، بحيث تضغط بالكبسة اليمنى للماوس على اسم المشروع الموجود تحت ال solution explorer ثم تختار copy web site ثم تحدد السيرفر الذي تريد ان تنقل اليه .

لكن ليست بهذه الطريقة حلت معي وانما هذا اقتراح وجدته في احد المنتديات الاجنبية ...........

انا اتصلت بمستضيف السيرفر وهم حلو هذه المشكلة بعمل creat new application للمجلد من خلال ال IIS اللي عندهم

اتمنى ان تتغلب على مشكلتك باقرب وقت .

logosite.gif
#10

شكرا أخي بشار على ردك

المشكلة لا تظهر إلا عندما أستخدم قاعدة بيانات في الموقع

عملت موقع للتجربة بدون قاعدة بيانات ويعمل بشكل سليم

اتصلت بالمستضيف وأخبرني أنه يمكنني استخدام DSN ولا يوجد أي تعديلات يقوم هو بها من اجل تشغيل IIS لانه أصلا يعمل على كل الموقع.

يقول المزود أن ASP العادي (ليس ASP.NET) يعمل بشكل سليم 100% عن طريق DSN وقال لي أنه يجب علي أن اصل الى قاعدة البيانات من خلال DSN وليس من خلال FileName، أي بطريقة مشابهة لوصولنا إلى قاعدة البيانات في PHP حيث أننا فقط نختار اسم قاعدة البيانات بدون أن نهتم باسم الملف

My_Sign.jpg
#11

اعاني من نفس هذه المشكلة اخبرنا لو توصلت للحل

#12

اخي الكريم ان محتوى الرسالة عباره عن تنبيه بوجود اخطاء بموقعك بغض النظر عن قاعدة البيانات

<configuration>

<system.web>

<customErrors mode="Off"/>

</system.web>

</configuration>

وعملية اضافة السطر

<customErrors mode="Off"/>

بين الاسطر داخل ملف الاتصال

<configuration>

<system.web>

</system.web>

</configuration>

وعرض هذه الرسالة تخبرك بان الموقع لايعرض تفاصيل الخطاء (اي لا يعرض كود الصفحة حفاضاً على بياناتك وسريتك)

ولعرض تفاصيل الخطاء ادخل السطر المذكور وعدل واحفظ ثم حدث تلاحظ ان سطر الخطاء قد جرد وحدد

ومن خلاله ستلاحظ المشكله هل في قاعدة البيانات او في اي كود اخر

ان الكود سيضهر على المستعرض فتجنب لو لديك بيانات او اكواد لاتريد عرضها وبعد حل المشكله يمكنك حذف السطرلتتجنب كشف الكود في اي وقت لاحق

تم تعديل هذه المشاركة بواسطة omran1 في 25 أغسطس 2008 في 09:09

مواضيع مشابهة