c# - Query to SQLite returning signed int16 but was defined as unsigned -
I ado Using SQLite for Net, properly nat v4.0 binaries
I have had a problem while trying to populate the data of a class based on the content to be removed from the database.
Reflection code:
var type = this.GetType (); Var Properties = Type. GetProperties (); Foreach (properties in properties) {property.SetValue (this, line [property.Name]); } However this throws an exception:
The type of object 'System.Int64' can not be typed 'System.UInt16'. The value is that trying to populate it is an ushort .
In order to form a table initially in SQL, that column is defined as 'unsecured smiling', which I understand as the C # ushort . Create SQL-
Make Table [Monster] ([Monster] Unsaid Smalling Faucet Unique, [Rajanam] VARCHAR (50) No, Zero, [Elementmask] Unsigned Tinet Unsigned tinet faucet is not there [arc] Unsigned tinet faucet is not there [int] Unsigned tinet faucet, [cone] Unsigned tinet faucet, [SPD] is not countless tinet faucet, [imagedset] Unsagged Smallling Nouvel) Removing Unschedged Should throws this exception:
type 'object' system 'Aianti been changed to 16' can not be typed 'System.UInt16'.
which is expected from signed / unsigned mismatch. Inspecting the line in debug mode shows the expected data
It is not certain what is going on, so any help would be appreciated.
Thank you.
uses SQLite; The column type is ignored, and the return value depends on the same value.
Use PropertyType to convert the value to the correct type.
Comments
Post a Comment