新窗口打开、xml与dataset、字符串取地址、sql不为空
时间:2010-11-23 来源:名字长不够写
2.
Webconfig
3.XML格式的字符串和DataSet之间的相互转换
1).xml转换成DataSet






2).DataSet转换成XML

string strXML=ds.GetXml();
4. 字符串截取-取地址
string url = Request.Url.ToString(); //获取当前页面的URL
int d=url.LastIndexOf('/'); //获取除最后一个“/”分隔的url长度
string suburl = url.Substring(0, d); //取出来
如果测试的url地址是http : //www.test.com/testweb/default.aspx, 结果如下:
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PhysicalApplicationPath: E:\WWW\testwebRequest.PhysicalPath:
Request.PhysicalPath: E:\WWW\testweb\default.aspx
Request.RawUrl: /testweb/default.aspx
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUrl: http://www.test.com/testweb/default.aspx
Request.Url.Host: www.test.com
Request.Url.LocalPath: /testweb/default.aspx
eg.
string url = Request.Url.ToString();
string path = Request.Path;
string testcenterUrl = "/UI/Pages/TalentC/TalentCenter.aspx";
string hostUrl = url.Substring(0, url.Length - path.Length);
5. SQL不为空
select * from Table
where name is not null