惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
Martin Fowler
Martin Fowler
爱范儿
爱范儿
IT之家
IT之家
Last Week in AI
Last Week in AI
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
The Cloudflare Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog

博客园 - 王祥 @ dot net 驿站

阿里云服务器Node环境配置 国内最快的jquery cdn HTML5 localStorage与document.domain设置问题 在FreeBSD上搭建Mac的文件及time machine备份服务 2012年年终总结:这一年,我玩大了 批处理操作压缩文件 为前端开发人员制作chrome扩展一枚jsbeautifier chrome中国版更新列表 自己总结的一些wap知识-WAP站点的MIME类型有哪些?如何添加? chrome os Google 可视化 API 很好,很强大! 关于浏览器的可视大小 jquery中ajax方法提交数据时,中文乱码问题解决。 javascripter之配合dot net工程师。 关于虚函数一个很好的解释 修改程序之感悟 自己的个人网站js中国正逐步完善着。 一个能描述erp系统的小故事。 计划学习研究模板引擎。学习stringtemplate先
DataRow对象数据绑定问题 - 王祥 @ dot net 驿站
王祥 @ dot net · 2008-02-24 · via 博客园 - 王祥 @ dot net 驿站

DataRow对象不能直接绑定到数据显示控件,如DataGrid。需要将DataRow数据copy到DataTable中,然后绑定到dataGrid上。
代码:

            Dim dt As DataTable = New DataTable
            datatable2 
= CType(Session("Result"), DataSet).Tables(0)  '数据源
            dt 
= datatable2.Clone() '复制表结构
            '导入数据列到数据表
            For Each dw As DataRow In datatable2.Select("xorw='" + DropDownList1.SelectedItem.Text + "'"
                dt.ImportRow(dw)
            Next

            DataGrid.DataSource 
= dt '绑定
            DataGrid.DataBind()


posted @ 2008-02-24 16:23  王祥 @ dot net 驿站  阅读(1011)  评论()    收藏  举报