Home All Groups Group Topic Archive Search About

Sql Query Outputs to a Variable

Author
22 Aug 2006 12:58 AM
Jl_G_0
Hey all.

  I have a OleDbCommand executing a query on a DB and I want it to
output the result of the query into a variable. (the result is just one
field)
  Whats the best way to do it ? If you guys could give me a hint I
could try to figure out the rest myself, I just need some advice on how
to begin....

Thanks.

Author
22 Aug 2006 1:48 AM
Terry Olsen
SqlCommand.ExecuteScalar

Show quoteHide quote
"Jl_G_0" <jlguerre***@gmail.com> wrote in message
news:1156208300.196732.171880@74g2000cwt.googlegroups.com...
> Hey all.
>
>  I have a OleDbCommand executing a query on a DB and I want it to
> output the result of the query into a variable. (the result is just one
> field)
>  Whats the best way to do it ? If you guys could give me a hint I
> could try to figure out the rest myself, I just need some advice on how
> to begin....
>
> Thanks.
>
Author
22 Aug 2006 2:32 AM
Jl_G_0
Just what I needed, it was so simple... but Im kinda new to .net (and
databases too)... Thanks again, its working now.