getting data from sql server dbs.. PLEASE HELP!

  • Thread starter Thread starter sona
  • Start date Start date
S

sona

Can anyone be kind enough to help me plz?
I am trying to get some value from the sql server
database, such as as sum of prices(select sum(price)
from ...) etc and display that number in a label. I have
already created a label, know the sql statement but how
do i put this data retrieved as the label content?
I can make the connections to the database, write the sql
string but not sure how to get the result as a label
rather than a datagrid..
I have tried this as a datagrid using the dataset,
adapter etc and display it as a data grid, it shows the
results as blank.. i may be doing something wrong this
way..I am not very experienced with asp.net so any advice
much appreciated!!!

Thanks.
 
Thank you, i think thats clear but i have never used this
execute scalar thing so sorry if im sounding stupid, but
the code in the link u gave, is that all i need to do?
how does this set the label to the result of the sql
string?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top