-1
私は私のxamarin.formsが
をプロジェクトにLINQを使用して、私のAzureのデータベースを更新したい
は、以下のデータベースに接続initaliseと同期する方法です。これらは正常に動作します。私の問題は、レコードを更新したいということです。データベースです。どんな提案も大歓迎です。
MobileServiceClient client = null;
IMobileServiceSyncTable<Shop> ShopTable2;
bool isInitialised;
public async Task Initialize()
{
if (isInitialised)
{
return;
}
this.client = new MobileServiceClient("link to database");
MobileServiceClient client = new MobileServiceClient("link to databse");
const string path = "user.db";
var store = new MobileServiceSQLiteStore(path);
store.DefineTable<Shop>();
await this.client.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler());
ShopTable2= this.client.GetSyncTable<Shop>();
isInitialised = true;
}
同期方法私はここにレコードを更新したい
public async Task Sync()
{
try
{
await shopTable2.PullAsync("allusers3", shopTable2.CreateQuery());
await client.SyncContext.PushAsync();
}
catch (Exception ex)
{
Debug.WriteLine("Unable to sync " + ex);
}
}
:
public async void BuyProducts(string Pname)
{
string productname = Pname;
await Initialize();
await SyncBookings();
List<Shop_TBL> item = await BookingsTable2
.Where(todoItem => todoItem.ProductName == productname)
.ToListAsync();
}
更新の仕方が分かりませんか?または、エラーまたは例外が発生していますか?あなたが持っている*具体的な問題は何ですか? – Jason
更新を行う方法がわからない@Jason – JohnDoe
@Jason更新方法を教えてください。 – JohnDoe