473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Empty DataSet and GridView

Hello,

Is it possible to display a message in a GridView such as "No Records
Available" when the DataSet is empty?

Thanks,

Miguel

Aug 21 '07 #1
3 2080
Hi Miguel,
GridView contains EmptyDataTemplate which is used in your case.

Regards,
Ladislav

"shapper" wrote:
Hello,

Is it possible to display a message in a GridView such as "No Records
Available" when the DataSet is empty?

Thanks,

Miguel

Aug 21 '07 #2
On Aug 21, 7:50 am, shapper <mdmo...@gmail.comwrote:
Hello,

Is it possible to display a message in a GridView such as "No Records
Available" when the DataSet is empty?

Thanks,

Miguel
You can also, if you would prefer the columns and grids did not
display as there is no data, to read the property Rows from the
GridView, and if (rows == 0) then alertLabel.Visible = true;
alertLabel.Text = "Blah blah"

Where an alertLabel is merely an invisible label you hide in your
screen to display only upon empty resultant sets.

Aug 21 '07 #3
or you could just not show the grid and show a message in its place if your
ds is empty.

something like
if(ds.row.count 0)
{
show grid
}
else
{
show no records found message
}

"shapper" <md*****@gmail.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...
Hello,

Is it possible to display a message in a GridView such as "No Records
Available" when the DataSet is empty?

Thanks,

Miguel

Aug 21 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David R. | last post by:
I would like to consume a web service. There is one method in this webservice that returns the results in a DataSet type. I know that I can return the data in a GridView control. However, if I...
0
by: Krish | last post by:
Hello, I have GridView and after binding data i can see cells empty only (empty row is created), but i checked database there is data available. I just started using GridView, trying to learn...
1
by: SomebodyElse | last post by:
Hi. Apologies if this has been asked here before - I've searched & searched but can't find anything. It's probably my serach parameters, but I'm having trouble even describing it to a search...
2
by: Stephen | last post by:
Hi, Suppose there is a column in the dataset that is a very large field (say varchar(500)) and i want to display partial information with (....) so that the user can click on it to view for...
4
by: ad | last post by:
Hi, How to determinate if a Gridview is empty?
1
by: rn5a | last post by:
I was using a DataView to bind records from a DB table to a DataGrid using the following code: Dim sqlDapter As SqlDataAdapter Dim dSet As DataSet Dim dView As DataView sqlDapter = New...
0
by: Adam Sandler | last post by:
Hello, Prior to posting I looked at http://groups.google.com/group/ microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ d8d5ae243614085e/d4fd6c4a5aa56f75 ...
3
by: ASPnewb1 | last post by:
I am currently filling a dataTable then adding this table to a dataset, setting the dataset to the Gridview's datasource. If I set the Gridview to generate columns automatically it will fill the...
3
by: dbuchanan | last post by:
How, at rundime, do I capture the fact that the parametrized query that fills a CheckBoxList results in an empty set. When the dataset is empty the CheckBoxList does not appear. I would like to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.