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.
Unfortunately, activation email could not send to your email. Please try again.

FindRecord - IConvertible

Thread ID:

Created:

Updated:

Platform:

Replies:

26508 Mar 23,2005 05:42 PM Mar 24,2005 09:28 AM Windows Forms 1
loading
Tags: Grouping
Shipra Gupta
Asked On March 23, 2005 05:42 PM

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

Administrator [Syncfusion]
Replied On March 24, 2005 09:28 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;