db.transaction(
function (transaction) {
transaction.executeSql('INSERT INTO EmployeeTable(Firstname,Lastname,BirthDate,EmployeeType,MaritalStatus,Company,IsActive,Dependents) values(?,?,?,?,?,?,?,?)',
[Firstname.toString(), Lastname.toString(), BirthDate, parseInt(empType), parseInt(marital),Company.toString(),active, parseInt(Dependents)]);
transaction.executeSql('SELECT * FROM EmployeeTable', [], function (transaction, results) {
result = results;
alert(result.length);
for (i = 0; i < results.length; i++) {
var EmployeeID = results.rows.item(i).EmployeeID;
var Firstname = results.rows.item(i).Firstname;
var Lastname = results.rows.item(i).Lastname;
alert(results.rows.item(i).EmployeeID + " " + results.rows.item(i).Firstname + " " + results.rows.item(i).Lastname);
//var product = [productid, productname, price, qty];
//insertTableRow(product,i);
}
}, null);
}
);
我正在使用 WEB SQL 作为本地数据库
想将使用 db.Transaction() 方法从 websql 检索到的数据发送到服务器控制器。
请帮助相同......
我应该如何将数据传输到 mvc 的控制器.....
[HttpPost]
public ActionResult Create(FormCollection collection)
{
try
{
if (Save(0, collection))
{
// List<char> bulkdata = collection["bulkdata"].ToList();
return RedirectToAction("Index");
}
else
{
return View("Edit");
}
}
catch
{
return View();
}
}