المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : problem with datatype



C# Programming
05-07-2009, 10:00 PM
Hi all,
i am fetching float value from SQL
select instanceid2400,CAST(weight as float) as GrossWeight from .....
but when i am reading it
Private Sub Fetch(ByVal dr As SafeDataReader)
'Load object data from the Database
With dr
_GrossWeight = .GetDouble("GrossWeight")
where _GrossWeight has also datatype as double
it's not working fine


similarly when i change my query to
select instanceid2400,CAST(weight as int) as GrossWeight from .....
_GrossWeight = .Getint32("GrossWeight")
it works fine

I am using vb.net

Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"