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.
Syncfusion Feedback

How to load the data from SQLite offline database into SfSchedule?

SfSchedule allows you to bind the data from local database by using SQLite. To achieve this, you need to follow the below steps.

Step 1: Add the database in to the cross-platform projects Resource folder.

Step 2: Create connection with the database using interface in cross platform projects and create interface in PCL project.

C#

 

Step 3: Create a class which inherits from the ISQLite interface in cross-platform project and get connection with the offline database using below code.

In Android cross-platform project

C#

 

In iOS cross-platform project

C#

 

In UWP cross-platform project

C#

 

Step 4: Create data model for SQLite.

C#

Note: Convert String type into DateTime type when adding items to the local collection from SQLite data model, since SQLite does not support DateTime type.

 

Step 5: Create SQLite data base table, and populate the data into the table.

C#

 

Step 7: Create another class other than SQLite data modal class for appointment mapping, since SQLite data modal class does not support certain data types.

C#

 

Step 8: Store the SQLite data into the collection (Here, Meetings).

C#

 

 

Step 9: Bind it to SfSchedule using SfSchedule.DataSource property.

XAML

 

 

Step 10: Refer the following link to know how to create SQLite connection,
http://developer.xamarin.com/guides/xamarin-forms/working-with/databases/

Note: To run this sample in UWP, install sqlite.net.pcl, version v1.0.10 (Only this version of SQLite supports UWP platform, later versions don’t support UWP).

Please refer the below UG link for more details about creating custom appointment mapping.

 

https://help.syncfusion.com/xamarin/sfschedule/getting-started#adding-custom-appointments

 

 

Sample Link: SQLiteSample

Article ID: Published Date: Last Revised Date: Platform: Control:
9125 08/13/2018 10/17/2018 Xamarin.Forms SfSchedule
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon 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.Close Icon