有限数据的网格视图。 [英] Grid View for limited data.

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

问题描述

我想在数据库中显示数据只有数据库只有3列的20列表,数据库表有5行我要检索的列,在我的网格中显示空行。

我如何处理gridview中的空行。

i want to show data in gridview from database only 3 column of 20 column table, database table have 5 null rows of that columns which i want to retrieve, in my grid empty rows are shown.
How can i handle empty rows in gridview.

推荐答案

你的问题没有提到你想如何处理空行,但如果你想要它们不被显示那么最好的方法是在用于检索数据的SQL查询中。

添加在哪里 [ ^ ]子句进入SQL查询排除 NULL [ ^ ]行:

Your question did not mention how you want to handle the empty rows, but if you want them not to be shown then the best way to do so is in the SQL query used to retrieve the data.
Add a WHERE[^] clause to the SQL query to exclude the NULL[^] rows:
WHERE column1 IS NOT NULL AND column2 IS NOT NULL and column3 IS NOT NULL and column4 IS NOT NULL and column5 IS NOT NULL


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

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