当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteAsyncConnection.UpdateAsync方法代码示例

本文整理汇总了C#中SQLite.SQLiteAsyncConnection.UpdateAsync方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteAsyncConnection.UpdateAsync方法的具体用法?C# SQLiteAsyncConnection.UpdateAsync怎么用?C# SQLiteAsyncConnection.UpdateAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLite.SQLiteAsyncConnection的用法示例。


在下文中一共展示了SQLiteAsyncConnection.UpdateAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

 public Task Update(MapModel map)
 {
     SQLiteAsyncConnection connection = new SQLiteAsyncConnection(SQLiteConfiguration.ConnectionString);
     _dataSources.Remove(_dataSources.First(source => source.ID.Equals(map.ID)));
     _dataSources.Add(map);
     return connection.UpdateAsync(map);
 }
开发者ID:CasaTeam,项目名称:MetroExplorer,代码行数:7,代码来源:MapServiceSQLite.cs

示例2: AddVisit

		public async Task<int> AddVisit(Visit visit) {
			SQLiteAsyncConnection conn = new SQLiteAsyncConnection(this.dbPath);
			if (visit.ID > 0) {
				return await conn.UpdateAsync(visit);
			}
			return await conn.InsertAsync(visit);
		}
开发者ID:jarwol,项目名称:WheredWeEat-CS,代码行数:7,代码来源:SQLiteAPI.cs

示例3: SetValueAsyncInternal

        private static async Task SetValueAsyncInternal(string name, string value, SQLiteAsyncConnection conn)
        {
            // if we don't have a connection, assume the system one...
            if(conn == null)
			    conn = StreetFooRuntime.GetSystemDatabase();

			// load an existing value...
			var setting = await conn.Table<SettingItem>().Where(v => v.Name == name).FirstOrDefaultAsync();
			if (setting != null)
			{
				// change and update...
				setting.Value = value;
				await conn.UpdateAsync(setting);
			}
			else
			{
				setting = new SettingItem()
				{
					Name = name,
					Value = value
				};

				// save...
				await conn.InsertAsync(setting);
			}
        }
开发者ID:jimgrant,项目名称:ProgrammingWindowsStoreApps,代码行数:26,代码来源:SettingItem.cs

示例4: btnOK_Click

        private async void btnOK_Click(object sender, RoutedEventArgs e)
        {

            SQLiteAsyncConnection conn = new SQLiteAsyncConnection(Path.Combine(ApplicationData.Current.LocalFolder.Path, "people.db"), true);
            //string[] per = new string[10];
 
            var per=App.ViewModel.Items[index];
            per.LineFive = watermarkTextBox.Text;
            per.Linesix = watermarkTextBox1.Text;
            per.Lineseven = watermarkTextBox2.Text;
            per.Lineeight = watermarkTextBox3.Text;
            Person person = new Person()

            {
                ID=per.Lineone,
                DoctorName=per.Linetwo,
                Date=per.Linethree,
                Time=per.LineFour,
                Temperature=per.LineFive,
                Bp=per.Linesix,
                symptoms=per.Lineseven,
                description=per.Lineeight

            };
           
            await conn.UpdateAsync(person);


            NavigationService.GoBack();
            
        }
开发者ID:ZytrixSathwikE,项目名称:Windows,代码行数:31,代码来源:Prescription.xaml.cs

示例5: updateSettings

 public static async Task<int> updateSettings(OCSettings settings)
 {
     settings.id = 1;
     String path = ApplicationData.Current.LocalFolder.Path + "/OCTranspo.sqlite";
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection(path);
     int result = await conn.UpdateAsync(settings);
     return result;
 }
开发者ID:jules2689,项目名称:OCTranspoWP8,代码行数:8,代码来源:OCTranspoStopsData.cs

示例6: Button_Click_5

 private async void Button_Click_5(object sender, RoutedEventArgs e)
 {
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection(ApplicationData.Current.LocalFolder.Path + "\\people.db");
     var query = conn.Table<Person>().Where(x => x.Name == "张三");
     var result = await query.ToListAsync();
     foreach (var item in result)
     {
         item.Work = "产品经理";
         await conn.UpdateAsync(item);
     }
 }
开发者ID:peepo3663,项目名称:WindowsPhone8,代码行数:11,代码来源:MainPage.xaml.cs

示例7: RunUpdateTest

        async Task RunUpdateTest()
        {
            var db = new SQLiteAsyncConnection(DatabasePath);
            var person = await db.GetAsync<Person>(f => f.FullName.EndsWith("8"));
            person.OtherField = "ABCD";
            await db.UpdateAsync(person);

            var updatedPerson = await db.GetAsync<Person>(f => f.FullName.EndsWith("8"));
            var message = updatedPerson.OtherField == "ABCD"
                            ? "Completed!"
                            : "Did not update person!";

            await dispatcher.RunIdleAsync(a => { UpdateResult = message; });
        }
开发者ID:kiwipom,项目名称:billboard,代码行数:14,代码来源:AsyncDatabaseViewModel.cs

示例8: InsertMenu

 public async static Task InsertMenu(Menu menu)
 {
     SQLiteAsyncConnection sqlConnection = new SQLiteAsyncConnection(DbHelper.DB_PATH);
     var collectionItem = await sqlConnection.Table<Menu>().Where(x => x.MenuId == menu.MenuId && x.CounterId == menu.CounterId).FirstOrDefaultAsync();
     if (collectionItem != null)
     {
         if (collectionItem.Version < menu.Version)
         {
             await sqlConnection.UpdateAsync(menu);
         }
     }
     else
     {
         System.Diagnostics.Debug.WriteLine("Menu Inserted: "+await sqlConnection.InsertAsync(menu));
     }
 }
开发者ID:maskaravivek,项目名称:FoodMenu,代码行数:16,代码来源:MenuStore.cs

示例9: InsertCounter

 public async static Task InsertCounter(Counter counter)
 {
     SQLiteAsyncConnection sqlConnection = new SQLiteAsyncConnection(DbHelper.DB_PATH);
     var collectionItem = await sqlConnection.Table<Counter>().Where(x => x.Id == counter.Id).FirstOrDefaultAsync();
     if (collectionItem != null)
     {
         if (collectionItem.MenuVersion != counter.MenuVersion)
         {
             await sqlConnection.UpdateAsync(counter);
         }
     }
     else
     {
         await sqlConnection.InsertAsync(counter);
     }
     await CounterSubscribed();
 }
开发者ID:maskaravivek,项目名称:FoodMenu,代码行数:17,代码来源:CounterStore.cs

示例10: InsertUpdateDataAsync

        public async Task<string> InsertUpdateDataAsync (UserVideo data)
        {
            try
            {
                var db = new SQLiteAsyncConnection (_path);

                if (await db.InsertAsync (data) != 0)
                    await db.UpdateAsync (data);
                
                return "Single data file inserted or updated";
            }
            catch (SQLiteException ex)
            {
                Log.Error (TAG, ex.Message);
                return string.Empty;
            }
        }
开发者ID:yonifra,项目名称:Shortie,代码行数:17,代码来源:DbHelper.cs

示例11: Update

        /// <summary>
        /// Update some records
        /// </summary>
        public async void Update(string sensor)
        {
            SQLiteAsyncConnection connection = new SQLiteAsyncConnection(textBox.Text);
            var SensorQry = await connection.Table<Sensor>().Where(x => x.Name.StartsWith(sensor)).FirstOrDefaultAsync();

            if (SensorQry != null)
            {
                SensorQry.dateTime = DateTime.Now;
                SensorQry.Value = GetRandomValue(SensorQry.Name);
                await connection.UpdateAsync(SensorQry);
            }
        }
开发者ID:Robotonics,项目名称:iotSampler,代码行数:15,代码来源:MainPage.xaml.cs

示例12: sifirla_Click

        private async void sifirla_Click(object sender, RoutedEventArgs e)
        {
            // SayfaID'sinden dualistesinde istenen duayı bul, kacKezOkundu değerini sıfırla
            SQLiteAsyncConnection conn = new SQLiteAsyncConnection("duaDB.db");
            var sayac = await conn.Table<Dualar>().Where(x => x.Id == sayfaID).FirstOrDefaultAsync();
            if (sayac != null)
            {
                sayac.kacKezOkundu = 0;
                await conn.UpdateAsync(sayac);
            }

            var allusers = await conn.QueryAsync<Dualar>("SELECT kacKezOkundu FROM DuaList WHERE Id = ?",sayfaID);
            foreach (var user in allusers)
            {
                //txtDuaSayaci.Text = user.kacKezOkundu.ToString();
                txtDuaSayisi.Text = user.kacKezOkundu.ToString();
            }
        }
开发者ID:fkaplan,项目名称:ZikirMatik,代码行数:18,代码来源:DuaSayfasi.xaml.cs

示例13: RemoveFriend_Click

 private async void RemoveFriend_Click(object sender, RoutedEventArgs e)
 {
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection("appData.db");
     await conn.CreateTableAsync<User>();
     String[] frList1 = currUser.friendsList.Split(',');
     String[] frList2 = clickedUser.friendsList.Split(',');
     string newList1 = "";
     string newList2 = "";
     foreach (string s in frList1) if (!s.Equals(clickedUser.Username)) newList1 += (s + ",");
     foreach (string s in frList2) if (!s.Equals(currUser.Username)) newList2 += (s + ",");
     currUser.friendsList = newList1;
     clickedUser.friendsList = newList2;
     await conn.UpdateAsync(currUser);
     await conn.UpdateAsync(clickedUser);
     var msg = new MessageDialog("User removed!");
     await msg.ShowAsync();
     this.Frame.GoBack();
 }
开发者ID:sunnypatel18,项目名称:ShoppingWithFriends,代码行数:18,代码来源:FriendView.xaml.cs

示例14: UpdateDB

 public async void UpdateDB(DB data)
 {
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection("exercice");
     await conn.UpdateAsync(data);
 }
开发者ID:Coyotealone,项目名称:Exercice-Vigenere,代码行数:5,代码来源:Fonctions.cs

示例15: insertUpdateData

 private async Task<string> insertUpdateData(Person data, string path)
 {
     try
     {
         var db = new SQLiteAsyncConnection(path);
         if (await db.InsertAsync(data) != 0)
             await db.UpdateAsync(data);
         return "Single data file inserted or updated";
     }
     catch (SQLiteException ex)
     {
         return ex.Message;
     }
 }
开发者ID:4lenz1,项目名称:recipes,代码行数:14,代码来源:MainActivity.cs


注:本文中的SQLite.SQLiteAsyncConnection.UpdateAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。