Update a specific row in Windows Azure Mobile Services SQL Database

两盒软妹~` 提交于 2019-12-08 12:52:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!