如果数据库表中有多个行为空,则显示弹出消息 [英] Display popup message if more than one row is empty in database table

查看:94
本文介绍了如果数据库表中有多个行为空,则显示弹出消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果数据库表中有多行为空,则显示弹出消息

========================== ==========================================



嗨专家!!



我正在使用ASP.NET,C#,SQLSERVER 2005.



在我的网页上我有一个提交按钮,当我点击这个按钮时,它应检查数据库表中是否有多行为空.....表名是(UserRecords)。



如果多行为空,则必须显示请添加记录的消息。



请帮帮我这样做



Thnks .........

Display popup message if more than one row is empty in database table
====================================================================

Hi Experts !!

am working on ASP.NET, C#, SQLSERVER 2005.

on my webpage i have a Submit button, when i click this button it should check if More than one row is empty in database table..... TABLE NAME is (UserRecords).

If more than one row is empty it must display a message "please add the records".

Please help me how to do this

Thnks.........

推荐答案

--Try this
SELECT Count(*) 
FROM   tbl_sample 
WHERE  name = 'srinu' 
GROUP  BY name 
HAVING Count(name) = 1 





通过使用上面的查询,你只能从表中获得一行。



使用此代码并编写代码以显示弹出消息没有来自数据库的行。



By using the above query you will get only one row from the table.

use this and write code to display the popup message if there is no row coming from the database.


这篇关于如果数据库表中有多个行为空,则显示弹出消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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