نمایش نتایج 1 تا 8 از 8

نام تاپیک: چگونگی تغییر در Web.conf از طریق صفحات وب

  1. #1
    کاربر دائمی
    تاریخ عضویت
    اردیبهشت 1385
    محل زندگی
    ایران - بروجرد
    پست
    723

    چگونگی تغییر در Web.conf از طریق صفحات وب

    با سلام
    من نیاز دارم که بتونم یک سری اطلاعات رو از Web.conf تغییر بدم البته در صفحه وب
    به طور مثال connectionString رو بتونم تغییر بدم
    از استاتید خواهمشند است که بنده رو راهنمایی کنند

  2. #2
    ASP.NET 2.0

    Configuration objConfig = WebConfigurationManager.OpenWebConfiguration("~");
    AppSettingsSection objConSettings = (AppSettingsSection)objConfig.GetSection("connecti onStrings");
    if (objConSettings != null)
    {
    objConSettings.Settings["conString"].Value = "Ye Chizi";
    objConfig.Save();
    }

  3. #3
    محروم شده آواتار rahele_sa
    تاریخ عضویت
    اردیبهشت 1385
    محل زندگی
    تهران
    پست
    246

    AppSettingsSection objConSettings = (AppSettingsSection)objConfig.GetSection("connecti onStrings");

    از این خط خطا میگره


    Unable to cast object of type 'System.Configuration.ConnectionStringsSection' to type 'System.Configuration.AppSettingsSection'.

  4. #4
    محروم شده آواتار rahele_sa
    تاریخ عضویت
    اردیبهشت 1385
    محل زندگی
    تهران
    پست
    246
    چرا کسی جواب نمیده ؟

  5. #5

  6. #6
    محروم شده آواتار rahele_sa
    تاریخ عضویت
    اردیبهشت 1385
    محل زندگی
    تهران
    پست
    246

    Exclamation


    <?xml version="1.0"?>
    <!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>

    <connectionStrings>
    <add name="MyDB_DBConnectionString" connectionString="Data Source=RAHELE;Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=1" providerName="System.Data.SqlClient" />
    </connectionStrings>

    <system.web>
    <customErrors mode="Off"/>
    <!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.
    -->
    <compilation debug="true"/>
    <!--
    The <authentication> section enables configuration
    of the security authentication mode used by
    ASP.NET to identify an incoming user.
    -->
    <authentication mode="Windows"/>
    <!--
    The <customErrors> section enables configuration
    of what to do if/when an unhandled error occurs
    during the execution of a request. Specifically,
    it enables developers to configure html error pages
    to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
    <error statusCode="403" redirect="NoAccess.htm" />
    <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>
    -->

    </system.web>


    </configuration>


  7. #7
    محروم شده آواتار rahele_sa
    تاریخ عضویت
    اردیبهشت 1385
    محل زندگی
    تهران
    پست
    246
    چرا کسی جواب نمی ده ؟!!!

  8. #8
    نقل قول نوشته شده توسط rahele_sa مشاهده تاپیک

    <?xml version="1.0"?>
    <!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>

    <connectionStrings>
    <add name="MyDB_DBConnectionString" connectionString="Data Source=RAHELE;Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=1" providerName="System.Data.SqlClient" />
    </connectionStrings>

    <system.web>
    <customErrors mode="Off"/>
    <!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.
    -->
    <compilation debug="true"/>
    <!--
    The <authentication> section enables configuration
    of the security authentication mode used by
    ASP.NET to identify an incoming user.
    -->
    <authentication mode="Windows"/>
    <!--
    The <customErrors> section enables configuration
    of what to do if/when an unhandled error occurs
    during the execution of a request. Specifically,
    it enables developers to configure html error pages
    to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
    <error statusCode="403" redirect="NoAccess.htm" />
    <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>
    -->

    </system.web>


    </configuration>

    با اجازه‌ی مدیر بخش :)

    Configuration objConfig = WebConfigurationManager.OpenWebConfiguration("~");
    ConnectionStringsSection objConSettings = (ConnectionStringsSection)objConfig.GetSection("co nnectionStrings");
    if (objConSettings != null)
    {
    objConSettings.ConnectionStrings["MyDB_DBConnectionString"].ConnectionString = "......";
    objConfig.Save();
    }

تاپیک های مشابه

  1. تغییر ارتفاع lineبا تغییر ارتفاع Textbox در گزارش
    نوشته شده توسط payam59 در بخش Access
    پاسخ: 22
    آخرین پست: یک شنبه 03 شهریور 1387, 15:41 عصر
  2. تغییر اندازه ارتفاع QRShape با تغییر ارتفاع DetailBand
    نوشته شده توسط mojtaba_z در بخش برنامه نویسی در Delphi
    پاسخ: 3
    آخرین پست: پنج شنبه 07 تیر 1386, 07:49 صبح
  3. تغییر Toolbar با تغییر Thems ویندوز XP
    نوشته شده توسط na3er-faraji در بخش VB.NET
    پاسخ: 2
    آخرین پست: پنج شنبه 06 مهر 1385, 12:08 عصر
  4. نحوه ذخیره شدن تغییرات در squid.conf
    نوشته شده توسط ssmehizadeh در بخش شبکه و Networking‌
    پاسخ: 1
    آخرین پست: شنبه 06 اسفند 1384, 13:17 عصر
  5. پاسخ: 1
    آخرین پست: جمعه 30 دی 1384, 16:12 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •