Showing posts with label price. Show all posts
Showing posts with label price. Show all posts

Monday, March 19, 2012

Bug with GetFloat?

I have field defined as float (price).

when I do the following command I get invalid cast.

reader.GetFloat(reader.GetOrdinal("price"));

I have to pull it with GetDouble.

reader.GetDouble (reader.getOrdinal("price"));

which works.

since it's defined as a float would that not make this an error.. or am I missing something?

GetFloat and GetDouble don't do any conversions. GetFloat expects a single precision and GetDouble a double precision value. Since the SQL Float is double precision you'll get an casting error with GetFloat. You could use GetFloat with a real field.

See "SQL Server Data Types and Their .NET Framework Equivalents" in books online for more info.

|||
When dealing with currency, why not create price as a sql type 'money'?

reader.GetDecimal (reader.getOrdinal("price")) would then work for you without throwing any casting exceptions.

Bug with GetFloat?

I have field defined as float (price).

when I do the following command I get invalid cast.

reader.GetFloat(reader.GetOrdinal("price"));

I have to pull it with GetDouble.

reader.GetDouble (reader.getOrdinal("price"));

which works.

since it's defined as a float would that not make this an error.. or am I missing something?

GetFloat and GetDouble don't do any conversions. GetFloat expects a single precision and GetDouble a double precision value. Since the SQL Float is double precision you'll get an casting error with GetFloat. You could use GetFloat with a real field.

See "SQL Server Data Types and Their .NET Framework Equivalents" in books online for more info.

|||
When dealing with currency, why not create price as a sql type 'money'?

reader.GetDecimal (reader.getOrdinal("price")) would then work for you without throwing any casting exceptions.

Sunday, February 12, 2012

bp server with the lowest price

bp server with the lowest price

Our company is a proffesional deticated bullet proof server and general server provider in china. If you're looking for a reliable and long term cooperation bp server provider, it deservers you to read our company file to know more about us.

we have the lowest price for bp server.

http://www.serverinchina.com/bpserverservice/index.htm

ICQ:226745581 MSN:dqkj#hotmail.com

ICQ:329211498 MSN:jiemie11#hotmail.com

Email: serverinchina#yahoo.com.cn
Website: www.mailinchina.com www.serverinchina.comproffesional deticated bullet proof server << spelling does'nt fill me with confidence ;-)|||I don't need a bullet-proof server. I need an IT-Manager proof one!|||You definitely deservers one.|||That's why there are no bullet points in the posting. So managers overlook it. Thus bullet-proof.|||Yes but is it shoulder fired missle proof?

Bottom 10?

I know the select distinct TOP 10 returns top ten highest price items but
what about top 10 lowest priced items?
Thanks
S.This is a multi-part message in MIME format.
--=_NextPart_000_04E8_01C3CEEC.B41FEA20
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
It's all in the ORDER BY:
select top 10
*
from
MyTable
order by
Price -- 10 cheapest
select top 10
*
from
MyTable
order by
Price DESC -- 10 most expensive
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:ODQ$ZYxzDHA.2156@.TK2MSFTNGP09.phx.gbl...
I know the select distinct TOP 10 returns top ten highest price items but
what about top 10 lowest priced items?
Thanks
S.
--=_NextPart_000_04E8_01C3CEEC.B41FEA20
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

It's all in the ORDER BY:
select top 10
=*
from
=MyTable
order by
=Price -- 10 cheapest
select top 10
=*
from
=MyTable
order by
Price DESC -- 10 most =expensive
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"SMAN" wrote in message news:ODQ$ZYxzDHA.2156=@.TK2MSFTNGP09.phx.gbl...I know the select distinct TOP 10 returns top ten highest price items =butwhat about top 10 lowest priced items?ThanksS.

--=_NextPart_000_04E8_01C3CEEC.B41FEA20--|||SELECT TOP 10 * FROM <your table> ORDER BY Price
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:ODQ$ZYxzDHA.2156@.TK2MSFTNGP09.phx.gbl...
> I know the select distinct TOP 10 returns top ten highest price items but
> what about top 10 lowest priced items?
> Thanks
> S.
>|||ahh...makes cents to me now...thank you so much!!!!
"J Young" <thorium48@.hotmail.com> wrote in message
news:OohzYexzDHA.4060@.TK2MSFTNGP11.phx.gbl...
> SELECT TOP 10 * FROM <your table> ORDER BY Price
> "SMAN" <ksanti@.nycap.rr.com> wrote in message
> news:ODQ$ZYxzDHA.2156@.TK2MSFTNGP09.phx.gbl...
> > I know the select distinct TOP 10 returns top ten highest price items
but
> > what about top 10 lowest priced items?
> >
> > Thanks
> >
> > S.
> >
> >
>|||This is a multi-part message in MIME format.
--=_NextPart_000_053D_01C3CEEF.AEBA81F0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
But will it make dollars to you later ... ;-)
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:OkpBWjxzDHA.1736@.TK2MSFTNGP09.phx.gbl...
ahh...makes cents to me now...thank you so much!!!!
"J Young" <thorium48@.hotmail.com> wrote in message
news:OohzYexzDHA.4060@.TK2MSFTNGP11.phx.gbl...
> SELECT TOP 10 * FROM <your table> ORDER BY Price
> "SMAN" <ksanti@.nycap.rr.com> wrote in message
> news:ODQ$ZYxzDHA.2156@.TK2MSFTNGP09.phx.gbl...
> > I know the select distinct TOP 10 returns top ten highest price items
but
> > what about top 10 lowest priced items?
> >
> > Thanks
> >
> > S.
> >
> >
>
--=_NextPart_000_053D_01C3CEEF.AEBA81F0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

But will it make dollars to you later =... ;-)
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"SMAN" wrote in message news:OkpBWjxzDHA.1736=@.TK2MSFTNGP09.phx.gbl...ahh...makes cents to me now...thank you so much!!!!"J Young" =wrote in messagenews:OohzYexzDHA.4060=@.TK2MSFTNGP11.phx.gbl...> SELECT TOP 10 * FROM ORDER BY =Price>> "SMAN" wrote in message> news:ODQ$ZYxzDHA.2156=@.TK2MSFTNGP09.phx.gbl...> > I know the select distinct TOP 10 returns top ten highest price itemsbut> > what about top 10 lowest priced =items?> >> > Thanks> >> > S.> =>> >>>

--=_NextPart_000_053D_01C3CEEF.AEBA81F0--|||You had better throw in 'WITH TIES'.
Else, you'll get screwed when there are a few products with the same price.
And that goes for your 'TOP 10 highest' query too.
James Hokes
"J Young" <thorium48@.hotmail.com> wrote in message
news:OohzYexzDHA.4060@.TK2MSFTNGP11.phx.gbl...
> SELECT TOP 10 * FROM <your table> ORDER BY Price
> "SMAN" <ksanti@.nycap.rr.com> wrote in message
> news:ODQ$ZYxzDHA.2156@.TK2MSFTNGP09.phx.gbl...
> > I know the select distinct TOP 10 returns top ten highest price items
but
> > what about top 10 lowest priced items?
> >
> > Thanks
> >
> > S.
> >
> >
>