本文是介绍js操作数据库的实例。请看下面示例代码:
var del = function(id) { if(window.confirm("确定删除吗?")) { Delete(id, function(req) { if(req.responseText == "1") { alert("删除成功!"); $("tr_" + id).style.display = "none"; } else { alert("错误!"); } } ); } return false; } public String Delete(int id) { String msg = String.Empty; String sql = "Delete from WB_AnnounceWhere Id = " + id.ToString(); return HWCommon.SQLCommon.ExecuteNonQuery(sql, DataAdapter.WeiboConnectString, out msg) ? "1" : "0"; }
声明:如需转载,请注明来源于www.webym.net并保留原文链接:http://www.webym.net/jiaocheng/772.html