在3层架构中借助xml绑定gridview [英] bind a gridview with the help of xml in 3 layer architecture

查看:57
本文介绍了在3层架构中借助xml绑定gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,
我是3层架构中xml的帮助下的gridview和其他控件的databind的新手.请给我一个例子.我会很感激你的.
谢谢.

hi sir,
i am new for the databind of gridview and other controls with the help of xml in 3 layer architecture. please suggest me with an example. I will be thankfull to you.
Thanks.

推荐答案

3层体系结构必须处理获取数据.您的数据绑定(无论检索到什么)仅是一个参与者-基于前端.
因此,根据您的图层逻辑,可以在前端获取XML格式的数据.拥有它后,使用它将其与网格绑定.

看这里:
如何将GridView控件绑定到ASP.NET中的XML [将XML数据绑定到GridView [
3 layer architecture has to deal with getting the data. Your binding of data (whatever retrieved) is only one player - front end based.
so, based on your layer logic, get the data in XML format in your frontend. Once you have it, use it to bind it with grid.

Look here:
How to Bind a GridView Control to XML in ASP.NET[^]
Binding XML Data to the GridView[^]

Try!


我在举一个简单的例子

i am giving a simple example

private void ReadxmlFromXmlTextReader(string file_Path )
    {
        DS_purchase = new DataSet(); // Create the DataSet to read the schema into.    
        FileInfo FInfo = new FileInfo(file_Path);
        if (FInfo.Exists)
        {
            System.Xml.XmlTextReader xmlReader = new System.Xml.XmlTextReader(FInfo.FullName);
            xmlReader.WhitespaceHandling = WhitespaceHandling.None;
            try
            {
                DS_purchase.ReadXml(xmlReader);
               }
            catch (Exception ex)
            {
                    
            }
            finally
            {
                xmlReader.Close();
            }

        }
        
    }


这篇关于在3层架构中借助xml绑定gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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