Hi Folks
Well, I've set up my classes and collections of classes, and now I'm trying to read data out of my database and into the fields of the class objects. Everything seems to work fine when I read out String vaules, but when I hit anything other than a string (a Short, let's say) I am getting a type conversion error. I tried surrounding the statement with a cType() function but that doesn't stop the error.
Here's a breif example of what I'm talking about:
RR = New clsRailroad
Me.RailroadTableAdapter.Fill(Me.DsSpatcher.Railroad)
RR.ID = CType(DsSpatcher.Railroad.Item("ID").ToString, Short)
RR.ID is defined in the class as a Short data type, and a Numeric in the DB (Access 2003).
The last statement brings a type conversion error with or without the cType() function.
I would prefer not to use the .ToString method on the end but there doesn't seem to be any alternative that I can find...?
Thanks for any help
CraigHartz
Well, I've set up my classes and collections of classes, and now I'm trying to read data out of my database and into the fields of the class objects. Everything seems to work fine when I read out String vaules, but when I hit anything other than a string (a Short, let's say) I am getting a type conversion error. I tried surrounding the statement with a cType() function but that doesn't stop the error.
Here's a breif example of what I'm talking about:
RR = New clsRailroad
Me.RailroadTableAdapter.Fill(Me.DsSpatcher.Railroad)
RR.ID = CType(DsSpatcher.Railroad.Item("ID").ToString, Short)
RR.ID is defined in the class as a Short data type, and a Numeric in the DB (Access 2003).
The last statement brings a type conversion error with or without the cType() function.
I would prefer not to use the .ToString method on the end but there doesn't seem to be any alternative that I can find...?
Thanks for any help
CraigHartz