问题
I am trying to update a specific row in Table of windows azure mobile services.
item is a reference to a row in the ToDoItem table, which has had some changes made to it.
private void updateItem(final ToDoItem item) {
if (mClient == null) {
return;
}
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
mToDoTable.update(item).get();
runOnUiThread(new Runnable() {
public void run() {
if (item.isComplete()) {
mAdapter.remove(item);
}
refreshItemsFromTable();
}
});
} catch (Exception exception) {
createAndShowDialog(exception, "Error");
}
return null;
}
}.execute();
}
and my Script in table is
function update(item, user, request) {
request.execute();
}
I want to select a row using an ID. While running this code, its just inserting a new row. Where i have to pass , ID , to update only the specified row.
来源:https://stackoverflow.com/questions/32665472/update-a-specific-row-in-windows-azure-mobile-services-sql-database