1
I have a table named profit model:我如何限制數據庫中的行數爲1?
我想活動不同的profitmodel,表中的數據將被更新。
現在我正在使用UpdateAsync,但它不工作......我該如何實現這一目標?
async void Active_Clicked(object sender, System.EventArgs e)
{
var profitmodel = (sender as Button).CommandParameter as ProfitModel;
await conn.CreateTableAsync<ProfitModelInUsed>();
//System.Diagnostics.Debug.WriteLine(product.ProductName);
var profitmodelInUsed = new ProfitModelInUsed
{
ProfitModel_ID = profitmodel.ProfitModel_ID,
ProfitModel_Name = profitmodel.ProfitModel_Name,
ExchangeRate = profitmodel.ExchangeRate,
Profit = profitmodel.Profit
};
await conn.UpdateAsync(profitmodelInUsed);
await DisplayAlert("This ProfitModel is Applied", profitmodelInUsed.ProfitModel_Name, "OK");
}
而且我不想在此表中有多行。
謝謝兄弟!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !你的建議是有幫助的!!!!!!!!!! –