Showing posts with label returned. Show all posts
Showing posts with label returned. Show all posts

Wednesday, March 21, 2012

Listbox to only appear if there are records returned from the SQL select query

I would like to make a listbox only appear if there are results returned by the SQL select statement.

I want this to be assessed on a click event of a button before the listbox is rendered.

I obviously use the ".visible" property, but how do I assess the returned records is zero before it is rendered?

hi,

there must be datasource(dataset or reader) for that listbox i believe.

if its dataset then use dataset.tables[0].Rows.Count, if its reader then use reader.hasrows.

hope it helps.

regards,

satish.

|||

Thanks Satish,

I used an if statement to assess if rows > 0

Cheers,

Ben.

|||

cheers BenSmile.

satish.

sql

Friday, February 24, 2012

List DMVs

what is the query to list all DMVs in SQL 2005 ?
I tried select * from sysobjects where name like 'dm%'
and it returned them
However select * from sys.objects where name like 'dm%' returns no results
Both executed in master database
Anyways, what is the right SQL to obtain list of DMVs as sysobjects is a
deprecated system table
Hi Hassan
Try this:
SELECT * FROM sys.system_objects
WHERE name LIKE 'dm%'
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Hassan" <Hassan@.hotmail.com> wrote in message
news:OpvHSd0FHHA.924@.TK2MSFTNGP02.phx.gbl...
> what is the query to list all DMVs in SQL 2005 ?
> I tried select * from sysobjects where name like 'dm%'
> and it returned them
> However select * from sys.objects where name like 'dm%' returns no results
> Both executed in master database
> Anyways, what is the right SQL to obtain list of DMVs as sysobjects is a
> deprecated system table
>

List DMVs

what is the query to list all DMVs in SQL 2005 ?
I tried select * from sysobjects where name like 'dm%'
and it returned them
However select * from sys.objects where name like 'dm%' returns no results
Both executed in master database
Anyways, what is the right SQL to obtain list of DMVs as sysobjects is a
deprecated system tableHi Hassan
Try this:
SELECT * FROM sys.system_objects
WHERE name LIKE 'dm%'
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Hassan" <Hassan@.hotmail.com> wrote in message
news:OpvHSd0FHHA.924@.TK2MSFTNGP02.phx.gbl...
> what is the query to list all DMVs in SQL 2005 ?
> I tried select * from sysobjects where name like 'dm%'
> and it returned them
> However select * from sys.objects where name like 'dm%' returns no results
> Both executed in master database
> Anyways, what is the right SQL to obtain list of DMVs as sysobjects is a
> deprecated system table
>

List DMVs

what is the query to list all DMVs in SQL 2005 ?
I tried select * from sysobjects where name like 'dm%'
and it returned them
However select * from sys.objects where name like 'dm%' returns no results
Both executed in master database
Anyways, what is the right SQL to obtain list of DMVs as sysobjects is a
deprecated system tableHi Hassan
Try this:
SELECT * FROM sys.system_objects
WHERE name LIKE 'dm%'
--
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Hassan" <Hassan@.hotmail.com> wrote in message
news:OpvHSd0FHHA.924@.TK2MSFTNGP02.phx.gbl...
> what is the query to list all DMVs in SQL 2005 ?
> I tried select * from sysobjects where name like 'dm%'
> and it returned them
> However select * from sys.objects where name like 'dm%' returns no results
> Both executed in master database
> Anyways, what is the right SQL to obtain list of DMVs as sysobjects is a
> deprecated system table
>