ASP.NET`config
之前一直做的WINFORM程序没有做过WEB的。习惯把做好的程序打包后,连接数据库的信息放在app.config中。
写一下以前做过的winform代码:
C# code:
string connnectionString = System.Configuration.ConfigurationManager.AppSettings["source"];
然后在app.config中写:
C# code:
<appSettings>
<add key="source" value="server=127.0.0.1;user id=root; password=; database=printjft; pooling=false;CharSet=utf8" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
_________________________________________________________________________________________
我现在要在web中实现 数据库信息写到 config中(web中有app.config么?或者是别的config?)
web中的代码如下:
C# code:
//定义水晶报表的数据库连接信息
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "Northwind";
connectionInfo.UserID = "xiaoming";
connectionInfo.Password = "woshixiaoming";
connectionInfo.ServerName
相关问答:
<script type="text/javascript" src="js/Dialog.js"></script>
<script type="text/javascript">
function zOpenD()
{
va ......
如下面的字符串:
abc-bdef-axdg,我只想取到第一个"-"的位置,该怎么写????
C# code:
string str = "abc-bdef-axdg";
Console.WriteLine(str.Substring(0, s ......
dsQuyMst.Tables["QuyMst"].Rows[0]["SHDOCO"] = "1111";//这句报错(未将对象引用设置到对象的实例。)
这知道是什么原因?
高人指点~~~
using System;
using System.Data;
us ......
function CheckOpwd(){//验证用户名
var pwd=document.all.txtOpwd;
var div1=document.getElementById("divPwd");
if (pwd.value=="")
{
......