Sunday 15 August 2010

c# - Fail to InsertAsync() into azure database -


I have a problem inserting data from mobile app in an Ezur database.

My database is defined as a database:

here Enter image details

This row records an error:

  Waiting for users. EnableInstantSync (New User {First Name = This.name Textbox Text, Last Name = this.ListNameTextBox.Text, DepartmentID = 0, LiveID = App.MobileService .CurrentUser.UserId, Level = 0, Plus = 0, Minus = 0 ,});   

Error message:

An exception to the type 'System.ArgumentException' was created in mscorlib.dll but the user was not handled in the code Additional information: ID not entered The member can already be set. If there is a handler for this exception, then the program can be safely continued.

And here's the definition of user class:

  class user {[Jasonproperty (PropertyName = "id")] Public string LiveID {get; Set; } [Jasonproporty (PropertyName = "Firstname")] Public String First Name {Received; Set; } [Jasonproperty (Property Name = "LastName")] Public String LastName {get; Set; } [Jasonprorty (Property Name = "Department ID")] Public Sector Department {ID; Set; } [Jasonproporty (property name = "level")] public int level {get; Set; } [Jasonproperty (Property Name = "plus")] Public Int Plus {Received; Set; } [Jasonproporty (Property Name = "Minus")] Public Atkins {Received; Set; }}    

I got a similar problem, in my case, during debugging, I I found that I had to put an entry with the same unique identifier, you can try this direction, and check the duplication before inserting it.

No comments:

Post a Comment