使用XML的数据列表数据绑定 [英] Datalist databinding using XML

查看:82
本文介绍了使用XML的数据列表数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用数据列表显示通过RSS feed获得的数据.
但是,获得的列表似乎很长,拥有
看起来并不好 一页上有这么多项目.有什么办法可以限制显示的条目数?还是可以在这里进行分页?我看了这篇文章,以便在数据列表上进行分页
但是,由于RSS提要,我无法处理"数据.

欢迎任何建议/帮助.

谢谢大家的期待.

问候,
siddy_17

Hello Everyone,

I am using a datalist to display data obtained using a RSS feed.
However, the list obtained seems to be quite long and it does not look good to have
so many items on a single page. Is there a way I can limit the number of entries shown? Or is paging possible here? I looked at the article for paging on a datalist
however, I am unable to ''work'' on the data as it comes through RSS feed.

Any suggestions / help is welcome.

Thank you all in anticipation.

Regards,
siddy_17

推荐答案

string myXMLfile = @"C:\MySchema.xml";
    DataSet ds = new DataSet();
    // Create new FileStream with which to read the schema.
    System.IO.FileStream fsReadXml = new System.IO.FileStream 
        (myXMLfile, System.IO.FileMode.Open);
    try
    {
        ds.ReadXml(fsReadXml);
        datalist.DataSource = ds;
       
    }
    catch (Exception ex)
    {
	MessageBox.Show(ex.ToString());
    }




希望对您有所帮助.




Hope this can help you.


这篇关于使用XML的数据列表数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆