日期:2014-05-18 浏览次数:21981 次
string FileContent = Session["data"].ToString(); string Name = name.Text.Trim().ToString(); string zuozhe = author.Text.Trim().ToString(); string jieshao = jianjie.Text.Trim().ToString(); string str = "insert into achievements(project_name,deveolpers,explanation,url) values('" + Name + "','" + zuozhe + "'','" + jieshao + "','" + FileContent + "')"; if (gwolf_bll.action1(str)) { Response.Write("<script>alert('数据插入成功!')</script>"); } else { Response.Write("<script>alert('数据插入失败!')</script>"); } public static bool action1(string SQLstring) { return gwolf_dal.zx(SQLstring); } public static bool zx(string SQLstring) { ConOpen(); Sqlcmd = new MySqlCommand(SQLstring, Sqlcon); try { int count = Convert.ToInt32(Sqlcmd.ExecuteNonQuery()); if (count > 0) { return true; } else { return false; } } catch (Exception) { return false; } finally { ConClose(); } }