datatype conversion problem when fetching fromn database
-
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 what can be the solution
Ankit Aneja "Nothing is impossible. The word itself says - I M possible"
-
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 what can be the solution
Ankit Aneja "Nothing is impossible. The word itself says - I M possible"
Ankit Aneja wrote:
With dr _GrossWeight = .GetDouble("GrossWeight") where _GrossWeight has also datatype as double it's not working fine
So what IS the result?? Are you getting a value?? What is the expected value and what is the actual value returned?? Is there an error message??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Ankit Aneja wrote:
With dr _GrossWeight = .GetDouble("GrossWeight") where _GrossWeight has also datatype as double it's not working fine
So what IS the result?? Are you getting a value?? What is the expected value and what is the actual value returned?? Is there an error message??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008just closed my editor and opened again it wrks something strange i din't get Thanks a lot
Ankit Aneja "Nothing is impossible. The word itself says - I M possible"