gridview检索数据 [英] gridview retreive data

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

问题描述

我有一个数据库

c1 c2 c3 c4
1 2 3 abc
1 2 3 efg
3 3 4 fgh


尝试将输出检索为

1 2 3 abc
efg
3 3 4 fgh

编写代码时


如果e.Row.RowType = DataControlRowType.DataRow然后

昏暗的sqlStr作为字符串

mystringdept = CType(e.Row.FindControl("c2"),Label).Text


不能放下

请帮助

i have a database

c1 c2 c3 c4
1 2 3 abc
1 2 3 efg
3 3 4 fgh


when trying to retrive output as

1 2 3 abc
efg
3 3 4 fgh

when sriting the code


If e.Row.RowType = DataControlRowType.DataRow Then

Dim sqlStr As String

mystringdept = CType(e.Row.FindControl("c2"), Label).Text


not getting out put

please help

推荐答案

如果我正确理解了您的要求,则希望合并gridview中的行.看一下以下链接:

http://csharpdotnetfreak.blogspot.com/2009/07/merge-gridview- cells-columns-aspnet.html [ ^ ]
在asp.net中合并gridview列 [ http://forums.asp.net/t/1807322.aspx/1 [ ^ ]
http://weblogs.asp.net/brijmohan/archive/2011/09/03/rows-and-columns-merging-in-asp-net-gridview-control.aspx [
If I understand your requirement correctly, you want to merge rows in your gridview. Take a look at following links:

http://csharpdotnetfreak.blogspot.com/2009/07/merge-gridview-cells-columns-aspnet.html[^]
merge gridview columns in asp.net[^]
http://forums.asp.net/t/1807322.aspx/1[^]
http://weblogs.asp.net/brijmohan/archive/2011/09/03/rows-and-columns-merging-in-asp-net-gridview-control.aspx[^]


建议您使用具有网格的数据列表

看到这篇文章
http://saudkhansblog.blogspot.in/2011/03/run-query-on- Dataset.html [ ^ ]
Suggest you use a datalist which has grids

see this post
http://saudkhansblog.blogspot.in/2011/03/run-query-on-dataset.html[^]


这篇关于gridview检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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