{"id":23061444,"url":"https://github.com/syncfusionexamples/loading-data-from-sqlite-online-database-from-xamarin.forms-listview-","last_synced_at":"2026-04-29T23:03:49.943Z","repository":{"id":38063254,"uuid":"200597930","full_name":"SyncfusionExamples/Loading-data-from-SQlite-online-database-from-xamarin.forms-listview-","owner":"SyncfusionExamples","description":"This repository contains the sample which loading data from SQlite online database in Xamarin.Forms ListView","archived":false,"fork":false,"pushed_at":"2024-05-28T13:17:19.000Z","size":2166,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T07:18:25.647Z","etag":null,"topics":["database","listview","sqlite","xamarin","xamarin-forms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SyncfusionExamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-05T06:47:19.000Z","updated_at":"2024-05-28T13:17:24.000Z","dependencies_parsed_at":"2025-02-09T23:33:13.840Z","dependency_job_id":null,"html_url":"https://github.com/SyncfusionExamples/Loading-data-from-SQlite-online-database-from-xamarin.forms-listview-","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SyncfusionExamples/Loading-data-from-SQlite-online-database-from-xamarin.forms-listview-","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2FLoading-data-from-SQlite-online-database-from-xamarin.forms-listview-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2FLoading-data-from-SQlite-online-database-from-xamarin.forms-listview-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2FLoading-data-from-SQlite-online-database-from-xamarin.forms-listview-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2FLoading-data-from-SQlite-online-database-from-xamarin.forms-listview-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SyncfusionExamples","download_url":"https://codeload.github.com/SyncfusionExamples/Loading-data-from-SQlite-online-database-from-xamarin.forms-listview-/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2FLoading-data-from-SQlite-online-database-from-xamarin.forms-listview-/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261583821,"owners_count":23180671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","listview","sqlite","xamarin","xamarin-forms"],"created_at":"2024-12-16T03:17:30.737Z","updated_at":"2026-04-29T23:03:49.866Z","avatar_url":"https://github.com/SyncfusionExamples.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loading data from SQLite online database\n\nThe SfListView allows binding the data from online database with the help of `Azure App Service`. To perform this, follow the steps:\n\nStep 1: Get URL to store the data online.\nStep 2: Create table using AppServiceHelpers.\nStep 3: Populate the data into the table using the ObservableCollection Items.\nStep 4: Bind it to SfListView using SfListView.ItemSource property.\nStep 5: Refer to the following link to know more about working with Azure App Service.\n[https://blog.xamarin.com/add-a-backend-to-your-app-in-10-minutes/](https://blog.xamarin.com/add-a-backend-to-your-app-in-10-minutes/)\n\n`Note` \n\n* Microsoft.Azure.Mobile.Client(v.2.1.1)\n* Microsoft.Azure.Mobile.Client.SQLiteStore(v.2.1.1)\n* AppService.Helpers (Does not support UWP platform)\n* AppService.Helpers.Forms (Does not support UWP platform)\n\nRefer to the following code which illustrates, how to initialize the library with the URL of the Azure Mobile App and registering the Model with the client to create a table.\n\n```\npublic App()\n{\n    InitializeComponent();\n    IEasyMobileServiceClient client = new EasyMobileServiceClient();\n    client.Initialize(\"http://xamarin-todo-sample.azurewebsites.net\");\n    client.RegisterTable\u003cToDo\u003e();\n    client.FinalizeSchema();\n    MainPage = new NavigationPage(new Pages.ToDoListPage(client));\n}\n```\nRefer to the following code which illustrates, how to create a table using AppServiceHelpers and insert items in it.\n\n```\nusing AppServiceHelpers.Abstractions;\nusing AppServiceHelpers.Models;\npublic class BaseAzureViewModel\u003cT\u003e : INotifyPropertyChanged where T : EntityData\n{\n    IEasyMobileServiceClient client;\n    ITableDataStore\u003cT\u003e table;\n\n    public BaseAzureViewModel(IEasyMobileServiceClient client)\n    {\n        this.client = client;\n        table = client.Table\u003cT\u003e();\n    }\n\n    // Returns an ObservableCollection of all the items in the table\n    ObservableCollection\u003cT\u003e items = new ObservableCollection\u003cT\u003e();\n    public ObservableCollection\u003cT\u003e Items\n    {\n        get { return items; }\n        set\n        {\n            items = value;\n            OnPropertyChanged(\"items\");\n        }\n    }\n\n    // Adds an item to the table.\n    public async Task AddItemAsync(T item)\n    {\n        await table.AddAsync(item);\n    }\n\n    // Deletes an item from the table.\n    public async Task DeleteItemAsync(T item)\n    {\n        await table.DeleteAsync(item);\n    }\n\n    // Updates an item in the table.\n    public async Task UpdateItemAsync(T item)\n    {\n        await table.UpdateAsync(item);\n    }\n\n    // Refresh the table and synchronize data with Azure.\n    Command refreshCommand;\n    public Command RefreshCommand\n    {\n        get { return refreshCommand ?? (refreshCommand = new Command(async () =\u003e await ExecuteRefreshCommand())); }\n    }\n\n    async Task ExecuteRefreshCommand()\n    {\n        if (IsBusy)\n            return;\n\n        IsBusy = true;\n\n        try\n        {\n            var _items = await table.GetItemsAsync();\n            Items.Clear();\n            foreach (var item in _items)\n            {\n                Items.Add(item);\n            }\n            IsBusy = false;\n        }\n        catch (Exception ex)\n        {\n            await Application.Current.MainPage.DisplayAlert(\"Error\", ex.Message, \"OK\");\n        }\n    }\n\n    public event PropertyChangedEventHandler PropertyChanged;\n    public void OnPropertyChanged(string propertyName)\n    {\n        if (PropertyChanged == null)\n            return;\n\n        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));\n    }\n}\n```\nRefer to the following code which illustrates, how to bind the table contents into the SfListView.\n\n```\n\u003cContentPage xmlns:syncfusion=\"clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms\"\u003e\n    \u003cContentPage.Content\u003e\n        \u003cStackLayout\u003e\n            \u003csyncfusion:SfListView x:Name=\"listView\" SelectedItem=\"{Binding SelectedToDoItem, Mode=TwoWay}\" ItemSize=\"50\"\u003e\n                \u003csyncfusion:SfListView.ItemTemplate\u003e\n                    \u003cDataTemplate\u003e\n                        \u003cViewCell\u003e\n                            \u003cStackLayout Orientation=\"Horizontal\" HorizontalOptions=\"FillAndExpand\" VerticalOptions=\"CenterAndExpand\"\u003e\n                                \u003cLabel Text=\"{Binding Text}\" /\u003e\n                                \u003cSwitch IsToggled=\"{Binding Completed}\"/\u003e\n                            \u003c/StackLayout\u003e\n                        \u003c/ViewCell\u003e\n                    \u003c/DataTemplate\u003e\n                \u003c/syncfusion:SfListView.ItemTemplate\u003e\n            \u003c/syncfusion:SfListView\u003e\n            \u003cButton Text=\"Add New\" Command=\"{Binding AddNewItemCommand}\"/\u003e\n            \u003cButton Text=\"Fetch\" Command=\"{Binding FetchItemCommand}\" /\u003e\n        \u003c/StackLayout\u003e\n    \u003c/ContentPage.Content\u003e\n\u003c/ContentPage\u003e\n```\n\n```\npublic partial class ToDoListPage : ContentPage\n{\n  public ToDoListPage(IEasyMobileServiceClient client)\n  {\n    InitializeComponent();\n    var viewModel = new ViewModels.ToDosViewModel(client);\n    BindingContext = viewModel;\n    listView.ItemsSource = viewModel.Items;\n  }\n  \n  private void FetchButton_Clicked(object sender, EventArgs e)\n  {\n    var viewModel1 = (ToDosViewModel)BindingContext;\n    viewModel1.RefreshCommand.Execute(null);\n  }\n}\n```\nTo know more about Xamarin.Forms ListView, please refer our documentation [here](https://help.syncfusion.com/xamarin/sflistview/working-with-sflistview)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncfusionexamples%2Floading-data-from-sqlite-online-database-from-xamarin.forms-listview-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncfusionexamples%2Floading-data-from-sqlite-online-database-from-xamarin.forms-listview-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncfusionexamples%2Floading-data-from-sqlite-online-database-from-xamarin.forms-listview-/lists"}