更改app.config文件中的appSettings? [英] change appSettings in app.config file?

查看:207
本文介绍了更改app.config文件中的appSettings?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

在我的程序中,我有一个app.config文件,

当我想使用appsetting时,我写下面的代码:

hi dears,
in my program, i have a app.config file,
when i want use appsetting, i write below code:

<pre lang="c#">ConfigurationSettings.AppSettings[0].ToString();



我的app.config代码在这里:


my app.config code is here:

<?xml version="1.0"?><configuration>
  <appSettings>
    <add key="connectionString" value="Data Source=.\sql2008;Initial Catalog=dbCar;Integrated Security=True"/>
  </appSettings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>



i想要改变下面的值,


i want change value like below,

Data Source=.\mssql;Initial Catalog=dbCar;Integrated Security=True



但我不知道如何更改它?。


but i don't know how i can change it?.

推荐答案

这很简单,所有开发人员都知道这个,即使只是初学者也知道这个。

你只需要把我的sql数据库连接字符串并粘贴它作为值。



查看我的sql连接字符串的链接点击此处 [ ^ ]



谢谢,

-RG
This is very simple, all developer know this even just beginners also know this.
You just take your my sql database connection string and paste it as value.

Look this link for My sql connection stringClick here[^]

Thanks,
-RG


这篇关于更改app.config文件中的appSettings?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆