如何在基于条件的情况下使用c#从xml中引入子类元素数据 [英] how to bring child class elements data from xml using c# in condition based
本文介绍了如何在基于条件的情况下使用c#从xml中引入子类元素数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的xml代码是
my xml code is
<?xml version="1.0" encoding="utf-8"?>
<registeration>
<Date>
</Date>
<Name>
</Name>
<Qualification>
</Qualification>
<areaofinterest>
</areaofinterest>
<yearofexperience>
</yearofexperience>
<Mobile>
</Mobile>
<EmailID>
</EmailID>
<Address>
</Address>
<Country>
</Country>
<City>
</City>
<state>
</state>
<Resume>
</Resume>
<registeration>
<Date>7/25/2013</Date>
<Name>Rajesh</Name>
<Qualification>B.E(Electronics and Communication)</Qualification>
<areaofinterest>dotnet</areaofinterest>
<yearofexperience>1</yearofexperience>
<Mobile>9790408079</Mobile>
<EmailID>rkumar9090@hotmail.com</EmailID>
<Address>chennai
</Address>
<Country>india</Country>
<City>chennai</City>
<state>tn</state>
<Resume>C:\Documents and Settings\Sweet Pc\Desktop\WebSite12\uploadresume\Rajesh Resume (2).doc</Resume>
</registeration>
<registeration>
<Date>7/26/2013</Date>
<Name>Rajesh</Name>
<Qualification>B.E(Computer Science Engineering)</Qualification>
<areaofinterest>dfh</areaofinterest>
<yearofexperience>5</yearofexperience>
<Mobile>5467</Mobile>
<EmailID>dfh@g.c</EmailID>
<Address>drfg</Address>
<Country>reh</Country>
<City>erh</City>
<state>eh</state>
<Resume>C:\Documents and Settings\Sweet Pc\Desktop\WebSite12\uploadresume\cab31.cab</Resume>
</registeration>
<registeration>
<Date>7/26/2013</Date>
<Name>Rajesh</Name>
<Qualification>B.E(Computer Science Engineering)</Qualification>
<areaofinterest>dfh</areaofinterest>
<yearofexperience>5</yearofexperience>
<Mobile>5467</Mobile>
<EmailID>dfh@g.c</EmailID>
<Address>drfg</Address>
<Country>reh</Country>
<City>erh</City>
<state>eh</state>
<Resume>C:\Documents and Settings\Sweet Pc\Desktop\WebSite12\uploadresume\cab31.cab</Resume>
</registeration>
</registeration>
我的c#代码是
My c# code is
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.BindGrid();
}
}
protected void Download(object sender, EventArgs e)
{
string filePath = (sender as LinkButton).Text;
if (File.Exists(filePath))
{
string fileName = Path.GetFileName(filePath);
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
Response.Charset = "";
Response.ContentType = "application/vnd.ms-word ";
Response.WriteFile(filePath);
Response.Flush();
Response.End();
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script type='text/javascript'>alert('file is not present');</script>");
}
}
protected void OnPageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.gvCustomers.PageIndex = e.NewPageIndex;
this.BindGrid();
}
private void BindGrid()
{
using (DataSet ds = new DataSet())
{
ds.ReadXml(Server.MapPath("formxml.xml"));
this.gvCustomers.DataSource = ds;
this.gvCustomers.DataBind();
}
}
protected void gvCustomers_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}
protected void gvCustomers_SelectedIndexChanged1(object sender, EventArgs e)
{
}
当我在文本框中输入日期时,我希望在日期中获取所有数据
when i enter the date within the text box i want to get all my datas within the date
推荐答案
检查此链接
http://support.microsoft.com/kb/308333 [ ^ ]
这篇关于如何在基于条件的情况下使用c#从xml中引入子类元素数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文