Binding a count total to a label

Mnemonic

Member
Joined
May 24, 2007
Messages
9
Programming Experience
1-3
Hey folks... im trying to take a select count query and bind it to a label... here's the query:

SELECT COUNT(ID) AS total
FROM DailySales
WHERE (saledate = @saledate)

Now... how do i tell the label to return the value of total? I can only databind to an acctual column in the properties, but not to a count result column...

Any ideas?

Thanks in advance!
 
thats a scalar query, you cannot bind it. Instead, just assign it to the label text every time you run it
 
watch this. Note that you dont dim a new one every time you run the query. If you run it a lot, dim it as a form variable once and repeatedly call it
 

Attachments

  • cjard_does_scalarquery.zip
    86 KB · Views: 25
Thank you so much for making a movie explaining how to do it!

Problem is, when i put in Dim x As New DBDataSetTableAdapters.QueriesTableAdapter, it says "Type 'DBDataSetTableAdapters.QueriesTableAdapter' is not defined"

Any ideas?
 
LOL, That was like an hour after i got in to the office after a very hung over weekend :-D I figured intellisense would just KNOW what i was talking bout ;)
 
I wrote a cool thing called ArtificiIntellisense, it is actually telepathic and writes code for me at the drop of a thought. You should see the uncompilable **** it churns out when the Uma Thurman screensaver pops up.

Did you know she's 6 foot, with size 11 feet? Meroww!
 
Back
Top