XML根据条件绑定combobox

ssrr1408 2010-10-18 11:39:22
<?xml version="1.0" encoding="gb2312" ?>
- <xml>
- <tables>
- <table>
- <tableRow>
<nameid>1</nameid>
<name>name</name>
<titleid>ttttttt</titleid>
<title>project1</title>
<userid>453</userid>
<username>admin</username>
</RESULTROW>
- <RESULTROW>
<nameid>1</nameid>
<name>name</name>
<titleid>ttttttt</titleid>
<title>project1</title>
<userid>453</userid>
<username>admin</username>
</tableRow>
</table>
</tables>
<ERRORINFO />
<CURRENTTIME>2010-10-18 23:04:45</CURRENTTIME>
<ISSUCCESS>true</ISSUCCESS>
</xml>

以上是xml的格式,根据userid查所有的值绑定到combobox中,
XmlDocument entityX = new XmlDocument();
entityX.Load(entityXmlString);
XmlNodeReader entityReader = new XmlNodeReader(entityX);
DataSet entityDS = new DataSet();
entityDS.ReadXml(entityReader);
entityReader.Close();
string caseid = ((System.Data.DataRowView)(comboBoxCases.SelectedItem)).Row.ItemArray[0].ToString();

comboBoxEntity.DataSource = null;
if (entityDS.Tables.Count > 3)
{
string caseids = "caseid='" + caseid + "'";
comboBoxEntity.Text = "---请选择---";
comboBoxEntity.DataSource = entityDS.Tables[3].Select(caseids);
comboBoxEntity.DisplayMember = "title";

}——————》我的代码,显示不出title这一列的值,请各位高手帮帮忙,谢了
...全文
122 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧