如何从Dataset获取第二行的第一行 [英] How to get first row of second table from Dataset

查看:169
本文介绍了如何从Dataset获取第二行的第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GridView1.DataSource = ds.Tables [1] .Rows [0];

GridView1.DataSource = ds.Tables[1].Rows[0];

推荐答案

GridView1.Rows.Add();
GridView1.Rows[0]= ds.Tables[1].Rows[0];


克隆该表并在新表中导入该行并将该表绑定到网格和如下所示。





clone that table and import that row in new table and bind that table to grid and shown below.


DataTable dtBind = ds.Tables[1].Clone();

           dtBind.ImportRow(ds.Tables[1].Rows[0]);

           GridView1.DataSource = dtBind;
           GridView1.DataBind();


这篇关于如何从Dataset获取第二行的第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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