private async void InsertTodoItem(StudentTable todoItem) { await todoTable.InsertAsync(todoItem); items.Add(todoItem); // TODO: Delete or comment the following statement; Mobile Services auto-generates the ID. // todoItem.Id = Guid.NewGuid().ToString(); //// This code inserts a new TodoItem into the database. When the operation completes //// and Mobile Services has assigned an Id, the item is added to the CollectionView //// TODO: Mark this method as "async" and uncomment the following statement. }
private async void Button_Click(object sender, RoutedEventArgs e) { try { s4 = combobox1.SelectedItem.ToString(); s5 = combobox2.SelectedItem.ToString(); StudentTable StudentTable1 = new StudentTable { sname = s1, email = s2, password = s3, tag = s4, gender = s5 }; //InsertTodoItem(StudentTable); await App.MobileService.GetTable <StudentTable>().InsertAsync(StudentTable1); this.Frame.Navigate(typeof(HubPage)); } catch (Exception ex) { var m1 = new MessageDialog("exce" + ex).ShowAsync(); } this.Frame.Navigate(typeof(HubPage)); }