private async void InsertComment(comments c) { try { var call = commentTable.InsertAsync(c); await call; if (call.IsFaulted) { MessageBox.Show("Comment add failed"); } if (call.IsCompleted) { MessageBox.Show("Comment add success"); } if (call.IsCanceled) { MessageBox.Show("Comment add cancelled"); } } catch (MobileServicePreconditionFailedException) { MessageBox.Show("Comment add failed"); } //items.Add(u); }
private void Button_Click(object sender, RoutedEventArgs e) { comments temp = new comments(); temp.loc_lat = lat; temp.loc_lng = lng; temp.username = uname; temp.commentposted = tbCom.Text; InsertComment(temp); }