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

Web Parts In Asp.net 2.

بدأه ehabash في 3 نوفمبر 2009 · 3 رد · 2,003 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه ،،

أنا في بداية دراستي لتصميم المواقع في ASP.NET 2.0 بلغة C# في بيئة فيجوال ستديو .نت 2005 و قواعد بيانات SQL SERVER 2005 .. وأثناء تطبيقي لتمرين وضع أجزاء الوب,قمت بإنشاء مشروع وب جديد على Http وأضفت له آداة Web part Manager و web part Zone ثم عملت Browes فظهر عندي error .26 كالتالي :

Server Error in '/UseWebParts' 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.

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the applications 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:

  1. If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
  2. If the applications App_Data directory already exists, the web server account only requires read and write access to the applications 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 applications 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 accounts credentials are used when creating the new database.
  3. Sql Server Express must be installed on the machine.
  4. 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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below

Stack Trace:

[sqlException (0x80131904): 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)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4860189 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +376 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4861315 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnect

ion owningConnection, DbConnectionPoolGroup poolGroup) +29 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4863644 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +82[HttpException (0x80004005): Unable to connect to SQL Server database.] System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +137 System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +94 System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +25 System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +395

توقعت ان السبب عدم تثبيت sql server على جهازي فقمت بتثبيته,, ولكنه ما زال الخطأ نفسه يظهر علما بأن المشروع لم يتم كتابة أي كود فيه حتى الآن ..فقط يتكون ن هاتين الآداتين...فما هو الحل إخواني الكرام؟

#2

webparts

موضوع شيق جداً .. وسلس في التعامل ..

- لابد من معرفة طبيعة المشكلة وهي :

حقيقة .. في المرة الأولى التي استخدمت فيها ( الـ webpart ) واجهت نفس المشكلة .. واتضح لي .. اننا الـ webpart يستخدم ( ASPNETDB.mdf ) حتى يقوم بتخزين بيانات الـ ( personlized data ) .. لذلك لابد من تركيب ( SQL Express ) ..

ولكن هذا الحل ضعيف .. لأن المشكلة ستستمر معك في حال قمت برفع ملفاتك للسيرفر ..

لذلك توجد عدة حلول لهذه المشكلة ..

1) تركيب ( SQL Express ) مثل ماذكرنا سابقاً .. وهذا الحل ينفع فقط في مواقع الانترانت ( المحلية ضمن الشبكة الداخلية ) .. وليس الانترنت ( أو لمواقع الانترنت ) ..

2) وهو الحل الأمثل ..

- اذهب الى visual studio tools وذلك من قائمة start ---> visual studio2008

- بعد ان تفتح معك نافذة الـ command prompt ..

قم بكتابة مايلي :

Aspnet_regsql.exe

بعد التنفيذ .. ستظهر لك شاشة .. اختر منها قاعدة البيانات التي تنوي استخدامها .. وقم فقط في كل مرة بالضغط على ( next ) في كل شاشة تظهر لك .. بعد الانتهاء ستجد ان جداول عدة قد تم انشاءها في قاعدة البيانات الخاصة فيك .. وهذا هو المطلوب ..

اذهب بعدها مباشرة للصفحة التي تحوي الـ webpart وقم بعملية التنفيذ .. ستجد انها تعمل بنسبة 100% باذن الله .. :)

اما في حال انك لاتملك قاعدة بيانات محددة .. قم بانشاء قاعدة بيانات من sql server للمشروع الخاص فيك .. وقم بتطبيق الحركة التي تم شرحها بالأعلى ..

واي استفسار آخر .. انا جاهز .. مع تحياتي .. (( ابو رزان )) .. :)

للمعلومية ..لمن يمر عليه الحل مرور الكرام .. الرجاء الاحتفاظ فيه لأنك احتمال ستحتاجه مستقبلا خصوصا ان عالم الـ webpart لن تجد حلول كثيرة تخصها .. خصوصا باللغة العربية ..

والمشكلة التي ذكرها الأخ .. هي دارجة عند كل من يستخدم الـ webpart لأول مرة .. والأدهى والأمر .. انك لن تجد الحل في معظم المواقع حتى باللغة الانجليزية ..

تم تعديل هذه المشاركة بواسطة hussein_razan في 24 فبراير 2010 في 10:48

#3
hussein_razan كتب:

webparts

موضوع شيق جداً .. وسلس في التعامل ..

- لابد من معرفة طبيعة المشكلة وهي :

حقيقة .. في المرة الأولى التي استخدمت فيها ( الـ webpart ) واجهت نفس المشكلة .. واتضح لي .. اننا الـ webpart يستخدم ( ASPNETDB.mdf ) حتى يقوم بتخزين بيانات الـ ( personlized data ) .. لذلك لابد من تركيب ( SQL Express ) ..

ولكن هذا الحل ضعيف .. لأن المشكلة ستستمر معك في حال قمت برفع ملفاتك للسيرفر ..

لذلك توجد عدة حلول لهذه المشكلة ..

1) تركيب ( SQL Express ) مثل ماذكرنا سابقاً .. وهذا الحل ينفع فقط في مواقع الانترانت ( المحلية ضمن الشبكة الداخلية ) .. وليس الانترنت ( أو لمواقع الانترنت ) ..

2) وهو الحل الأمثل ..

- اذهب الى visual studio tools وذلك من قائمة start ---> visual studio2008

- بعد ان تفتح معك نافذة الـ command prompt ..

قم بكتابة مايلي :

Aspnet_regsql.exe

بعد التنفيذ .. ستظهر لك شاشة .. اختر منها قاعدة البيانات التي تنوي استخدامها .. وقم فقط في كل مرة بالضغط على ( next ) في كل شاشة تظهر لك .. بعد الانتهاء ستجد ان جداول عدة قد تم انشاءها في قاعدة البيانات الخاصة فيك .. وهذا هو المطلوب ..

اذهب بعدها مباشرة للصفحة التي تحوي الـ webpart وقم بعملية التنفيذ .. ستجد انها تعمل بنسبة 100% باذن الله .. :)

اما في حال انك لاتملك قاعدة بيانات محددة .. قم بانشاء قاعدة بيانات من sql server للمشروع الخاص فيك .. وقم بتطبيق الحركة التي تم شرحها بالأعلى ..

واي استفسار آخر .. انا جاهز .. مع تحياتي .. (( ابو رزان )) .. :)

للمعلومية ..لمن يمر عليه الحل مرور الكرام .. الرجاء الاحتفاظ فيه لأنك احتمال ستحتاجه مستقبلا خصوصا ان عالم الـ webpart لن تجد حلول كثيرة تخصها .. خصوصا باللغة العربية ..

والمشكلة التي ذكرها الأخ .. هي دارجة عند كل من يستخدم الـ webpart لأول مرة .. والأدهى والأمر .. انك لن تجد الحل في معظم المواقع حتى باللغة الانجليزية ..

السلام عليكم

عندي نفس المشكله ،عملت الخطوات المذكوره

بس ما زبط شي

ليه؟؟؟؟ بتمني تساعدوني

سيصبح كل شئ على ما يرام ذات يوم ....هذا هو املنا

اما ان نقول كل شئ على ما يرام اليوم....فهذا هو الوهم

#4

وين الردود............؟؟؟؟؟؟؟؟؟؟؟؟؟

سيصبح كل شئ على ما يرام ذات يوم ....هذا هو املنا

اما ان نقول كل شئ على ما يرام اليوم....فهذا هو الوهم

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