求助xml的读取问题 - .NET技术 / C#
我想建一个数组strs保存来自XMLFile1.xml的相关数据。数组最后是用来给combobox选择用的
这是我用来模糊查询用的: XmlDataDocument _xmlData = null;
XmlNodeList _xmlNodeList = null;
try
{
string xmlFile = Application.StartupPath + "\\XMLFile1.xml";
_xmlData = new XmlDataDocument();
_xmlData.Load(xmlFile);
string xpath = "//lines";
if (textBox1.Text != "")
{
xpath += "[contains(name,'{0}')]";
xpath = String.Format(xpath, this.textBox1.Text);
}
这是关联combobox的代码:
if (this.comboBox1.Text == "aaa")
{
this.comboBox2.Items.Clear();
comboBox2.Items.Add("选择");
string[] temp =strs[0].Split(',');
for (int i = 0; i < temp.Length; i++)
comboBox2.Items.Add(temp[i]);
}
XMLFile1.xml如下:
<?xml version="1.0" encoding="utf-8" ?>
<bus>
<linestops>
<!-- 站点路线 --&
相关问答:
可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......
思路:要用c#生成一个播放机的播放列表的xml,例如:
<daty datys='2010-04-05' datye='2010-05-01' > //这是播放的日期段
<time times='01:12:00' timee='02:30:00'> ......
XML文件内容:
- <ResList>
<page>0</page>
- <resItem>
<resName>WWW</resName>
</resItem>
- <resItem>
&nb ......
求一本C#设计模式的书 ,我感觉我的代码运用接口,委托,属性的地方很少,肯定是我的设计模式太差了 ,有没有这方面,从国外翻译过来的,比较好的设计模式的书,推荐一下吧,非常感谢.
高人们说 代码重构的书好些,那我要改看 ......