database - How to load data from azure to a xamarin form using data binding -
i having problem loading data azure database xamarin forms listview. problem have gettaskasync statement, have modified controller , builds gives me system.
tpyeinitializationexception error message when try data db. template, used todo list example way data both share same db without luck. advice appreciated. please if can point out went wrong or have examples can see better idea on problem appreciate it. in advance.
public partial class continentcontroller { static continentcontroller defaultinstance = new continentcontroller(); mobileserviceclient client; imobileservicetable<continent> continenttable; private continentcontroller() { this.client = new mobileserviceclient( constants.applicationurl); this.continenttable = client.gettable<continent>(); } public static continentcontroller defaultmanager { { return defaultinstance; } private set { defaultinstance = value; } } public mobileserviceclient currentclient { { return client; } } public async task<observablecollection<continent>> getcontinentsasync(bool syncitems = false) { try { ienumerable<continent> items = await continenttable .where(c => c.continentname == "africa") .toenumerableasync(); return new observablecollection<continent>(items); } catch (mobileserviceinvalidoperationexception msioe) { debug.writeline(@"invalid sync operation: {0}", msioe.message); } catch (exception e) { debug.writeline(@"sync error: {0}", e.message); } return null; } }
here screen shot of current error:
Comments
Post a Comment