如何使用XSD文件填充gridview [英] how to populate gridview using xsd file

查看:80
本文介绍了如何使用XSD文件填充gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友
我只想使用.xsd文件填充gridview
请帮助我

解决方案

,所以我想尝试使用dataset1.xsd进行gridview,而不是使用honeydata1.xsd文件. blockquote>

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);
       dataGrid1.DataSource = ds;
       dataGrid1.DataMember = "Cust";
   }
   catch (Exception ex)
   {
   MessageBox.Show(ex.ToString());
   }



希望对您有所帮助.


dear friends
i just want to populate gridview using .xsd file
please help me

解决方案

so I want to try gridview using dataset1.xsd ,but not using dataset1.xsd file,hoho.


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);
       dataGrid1.DataSource = ds;
       dataGrid1.DataMember = "Cust";
   }
   catch (Exception ex)
   {
   MessageBox.Show(ex.ToString());
   }



Hope this can help you.


这篇关于如何使用XSD文件填充gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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