We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FindRecord - IConvertible

Hello, I am using GroupingGrid.Table.PrimaryKeySortedRecords.FindRecord function to find a record given the primary key. The primary key consists of 1 string and 2 intergers. The primary key is bundled together as type object and passed to FindRecord function but I get an unhandled exception from mscorlib, System.Object ChangeType(System.Object, System.Type. System.IFormatProvider) function indicating that the object must implement IConvertible. Is there a sample available where FindRecord is used with composite primary keys? Thanks Shipra

1 Reply

AD Administrator Syncfusion Team March 24, 2005 02:28 PM UTC

Hi Shipra, we made changes to ChangeType for the 3.x version to be able to handle more scenarios. So, with 3.x the problem might go away. Otherwise with 2.x you will need to implement IConvertible interface for the object that is stored in your database as PrimaryKey. ChangeType will query IConvertible to match up the type that is passed in to FindRecord to be of exactly the same type as the object store in the record. Attached find also a sample for Multiple primary keys: http://www.syncfusion.com/Support/user/uploads/MultiplePrimaryKey_834307a8.zip Stefan MultiplePrimaryKey.zip Stefan >Hello, > >I am using GroupingGrid.Table.PrimaryKeySortedRecords.FindRecord function to find a record given the primary key. The primary key consists of 1 string and 2 intergers. The primary key is bundled together as type object and passed to FindRecord function but I get an unhandled exception from mscorlib, System.Object ChangeType(System.Object, System.Type. System.IFormatProvider) function indicating that the object must implement IConvertible. > >Is there a sample available where FindRecord is used with composite primary keys? > >Thanks >Shipra

Loader.
Live Chat Icon For mobile
Up arrow icon