Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Submit_Click(object sender, RoutedEventArgs e)
- {
- user temp = new user();
- temp.Username = UserName.Text;
- temp.Password = Password.Text;
- dataBase.AddTouser(temp);
- IAsyncResult result = dataBase.BeginSaveChanges(new AsyncCallback (OnSaveChangesCompleted), temp);
- }
- void OnSaveChangesCompleted(IAsyncResult result)
- {
- try
- {
- string name = ((user) result.AsyncState).Username.ToString();
- dataBase.EndSaveChanges(result);
- }
- catch (DataServiceRequestException ex)
- {
- MessageBox.Show("OnSaveChangesCompleted Error: " + ex.ToString());
- }
- }
- public static void InitializeService(IDataServiceConfiguration config)
- {
- config.SetEntitySetAccessRule("*", EntitySetRights.All);
- config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
- }
Add Comment
Please, Sign In to add comment