private async void InsertUser(tbl_user u) { try { var call = userTable.InsertAsync(u); await call; if (call.IsFaulted) { MessageBox.Show("Registration failed"); } if (call.IsCompleted) { MessageBox.Show("Registration success"); } if (call.IsCanceled) { MessageBox.Show("Registration cancelled"); } } catch (MobileServicePreconditionFailedException) { MessageBox.Show("Registration failed"); } //items.Add(u); }
private void Button_Click(object sender, RoutedEventArgs e) { tbl_user u = new tbl_user(); u.firstname = tbfirstname.Text; u.lastname = tblastname.Text; u.username = tbuname.Text; u.password = tbpwd.Text; u.email = tbemail.Text; InsertUser(u); }