0
嘗試通過Web服務將數據發送到我的數據庫中得到這個錯誤:WinJS的OData JSON
Primitive values of type 'Edm.Decimal' and 'Edm.Int64' must be quoted in the payload. Make sure the value is quoted
這裏是我的代碼:
var newEntry = {
datum: entryDate,
monat: parseFloat(entryMonth),
taetigkeit: document.getElementById("addWork").value,
total: parseFloat(document.getElementById("addTotal").value),
totalV: parseFloat(document.getElementById("addTotalV").value),
in_auswertung: 0,
teil_projekt_id: parseFloat(document.getElementById("addSubProject").value),
projekt_id: parseFloat(document.getElementById("addProject").value),
TimeStamp: entryDate,
sAuftraggeber: document.getElementById("addContractor").value,
iidBenutzer: parseFloat(298),//sessionStorage.getItem("userId"),
akt_id: parseFloat(document.getElementById("addActivity").value)
};
WinJS.xhr({
type: "post",
url: requestUrl,
data: JSON.stringify(newEntry),
headers: {
"Content-type": "application/json"
}
}).then(
function complete(response) {
},
感謝 馬洛
問題已解決。非常感謝! – Marlowe 2013-05-15 04:57:16
如果此答案適用於您,您是否可以將其標記爲已接受?謝謝! – 2013-05-15 16:01:38
對不起,但我怎麼接受? – Marlowe 2013-05-16 09:51:07