PDA

View Full Version : سوال: کانکشن استرینگ و web.config



love20
یک شنبه 06 تیر 1389, 16:49 عصر
با سلام

چند سوال در مورد کانکشن استرینگ و فایل web.config داشتم:

1. اگه سایتم رو به سرور جدید منتقل کنم آیا نیاز هست برای دیتابیس موردنظر رو سرور جدید کانکشن استرینگ جدید تعریف کنیم؟

2. آیا نیاز به تغییر در web.config هست؟

من سایتم رو به سرور جدید انتقال دادم دیتابیس رو هم همین. اطلاعات web.config رو هم براساس سرور جدید تغییر دادم ولی ارور کانکشن استرینگ میزنه!!!

لطفاً در این مورد راهنمایی کنید.

maxpayn2
یک شنبه 06 تیر 1389, 16:58 عصر
ممکنه نسبت به تنظیمات سرور نیاز باشه کانکشن استرینگ خاصی رو بنویسی ، کانکشن استرینگ و خطا رو بزار تا بشه بهتر جواب داد

daryasalar
یک شنبه 06 تیر 1389, 16:59 عصر
سلام.نيازي به تعريف كانكشن جديد نيست اما نام ديتاسورسي كه همان نام سرور هست بايد با توجه به سيستم لوكال فعلي تنظيم شود.
ارور رو بزاريد ببينيم به خاطر چي هست.

love20
یک شنبه 06 تیر 1389, 17:29 عصر
اینم از کانکشن استرینگ:



</appSettings>
<connectionStrings>


<add name="KianConnectionString" connectionString="Data Source=servername;Initial Catalog=hoshmand ;uid=test ; pwd= dfhygjhf ;"/>
<add name="ConnectionString" connectionString="Data Source=servername;Initial Catalog=hoshmand ;uid=test ; pwd= dfhygjhf ;"/>

</connectionStrings>
<system.web>


اینم از ارور:



Server Error in '/test2' Application.

The connection name 'KianConnectionString' was not found in the applications configuration or the connection string is empty.

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.InvalidOperationException: The connection name 'KianConnectionString' was not found in the applications configuration or the connection string is empty.

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:

[InvalidOperationException: The connection name 'KianConnectionString' was not found in the applications configuration or the connection string is empty.] System.Web.Compilation.ConnectionStringsExpression Builder.GetConnectionString(String connectionStringName) +2472578 ASP.default_aspx.__BuildControlsdsLinks() +81 ASP.default_aspx.__BuildControlContent2(Control __ctrl) +107 System.Web.UI.CompiledTemplateBuilder.InstantiateI n(Control container) +12 ASP.masterpage_master.__BuildControlContentPlaceHo lder1() +113 ASP.masterpage_master.__BuildControlform1() +199 ASP.masterpage_master.__BuildControlTree(masterpag e_master __ctrl) +105 ASP.masterpage_master.FrameworkInitialize() +37 System.Web.UI.UserControl.InitializeAsUserControlI nternal() +35 System.Web.UI.MasterPage.CreateMaster(TemplateCont rol owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8668271 System.Web.UI.Page.get_Master() +51 System.Web.UI.Page.ApplyMasterPage() +15 System.Web.UI.Page.PerformPreInit() +45 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282

maxpayn2
چهارشنبه 09 تیر 1389, 08:35 صبح
با پشتیبانیه سرور جدید تماس گرفتی ؟

mohsen.nsb44
چهارشنبه 09 تیر 1389, 09:08 صبح
اینم از کانکشن استرینگ:



</appSettings>
<connectionStrings>


<add name="KianConnectionString" connectionString="Data Source=servername;Initial Catalog=hoshmand ;uid=test ; pwd= dfhygjhf ;"/>
<add name="ConnectionString" connectionString="Data Source=servername;Initial Catalog=hoshmand ;uid=test ; pwd= dfhygjhf ;"/>

</connectionStrings>
<system.web>


اینم از ارور:



Server Error in '/test2' Application.

The connection name 'KianConnectionString' was not found in the applications configuration or the connection string is empty.

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.InvalidOperationException: The connection name 'KianConnectionString' was not found in the applications configuration or the connection string is empty.

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:

[InvalidOperationException: The connection name 'KianConnectionString' was not found in the applications configuration or the connection string is empty.] System.Web.Compilation.ConnectionStringsExpression Builder.GetConnectionString(String connectionStringName) +2472578 ASP.default_aspx.__BuildControlsdsLinks() +81 ASP.default_aspx.__BuildControlContent2(Control __ctrl) +107 System.Web.UI.CompiledTemplateBuilder.InstantiateI n(Control container) +12 ASP.masterpage_master.__BuildControlContentPlaceHo lder1() +113 ASP.masterpage_master.__BuildControlform1() +199 ASP.masterpage_master.__BuildControlTree(masterpag e_master __ctrl) +105 ASP.masterpage_master.FrameworkInitialize() +37 System.Web.UI.UserControl.InitializeAsUserControlI nternal() +35 System.Web.UI.MasterPage.CreateMaster(TemplateCont rol owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8668271 System.Web.UI.Page.get_Master() +51 System.Web.UI.Page.ApplyMasterPage() +15 System.Web.UI.Page.PerformPreInit() +45 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
شما بايد در كنترل پنل هاست خود يك ديتابيس ايجاد كني و يوزر نيم و پسورد تعريف كني واسش اين يوزر نيم پسورد رو تو كانكشن استرينگت بياري
اگه همين كارارو كردي و بازم ارور داد همانطور كه دوسنمون اشاره كردند با پشتيباني هاست تماس بگيريد و مشكلتونو در ميان بگذاريد.

love20
چهارشنبه 09 تیر 1389, 17:55 عصر
شما بايد در كنترل پنل هاست خود يك ديتابيس ايجاد كني و يوزر نيم و پسورد تعريف كني واسش اين يوزر نيم پسورد رو تو كانكشن استرينگت بياري
اگه همين كارارو كردي و بازم ارور داد همانطور كه دوسنمون اشاره كردند با پشتيباني هاست تماس بگيريد و مشكلتونو در ميان بگذاريد.



تموم کارایی که گفتی از قبل انجام دادم. من با پشتیبانی هاست هم مشکلم رو در میون گذاشتم ولی اونا گفتند تو اینترنت سرچ کنی میتونی مشکلت رو حل کنی. حالا موندم چیکار کنم؟ (در ضمن من از کنترل پنل پلسک(ریسلری) استفاده می کنم)

maxpayn2
پنج شنبه 10 تیر 1389, 11:16 صبح
ولی اونا گفتند تو اینترنت سرچ کنی میتونی مشکلت رو حل کنی.

از کدوم شرکت هاست خریدی ؟

mohsen.nsb44
پنج شنبه 10 تیر 1389, 11:21 صبح
تموم کارایی که گفتی از قبل انجام دادم. من با پشتیبانی هاست هم مشکلم رو در میون گذاشتم ولی اونا گفتند تو اینترنت سرچ کنی میتونی مشکلت رو حل کنی. حالا موندم چیکار کنم؟ (در ضمن من از کنترل پنل پلسک(ریسلری) استفاده می کنم)
دوست عزيز اگه شما تمام اين كار ها رو به صورت صحيح انجام داده باشيد مشكل از جانب شركت خدمات دهنده هاستينگ هستش شما بايد با تماس با ايشان تاكيد بر رفع مشكلتون توسط پشتيبان باشيد .