码迷,mamicode.com
首页 > 数据库 > 详细

asp.net(C#)写SQL语句技巧

时间:2014-09-15 15:45:09      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:style   color   os   for   sp   c   sql   r   .net   

/*添加SQL*/
string fields = "";
string values = "";
fields += "xm"; values += "‘" + Request.Form["xm"].ToString() + "‘";
fields += ",xb"; values += ",‘" + Request.Form["xb"].ToString() + "‘";
fields += ",sfz"; values += ",‘" + Request.Form["sfz"].ToString() + "‘";
fields += ",dzyj"; values += ",‘" + Request.Form["dzyj"].ToString() + "‘";
sql = "insert into EKECMS_EKETEAM (" + fields + ") values (" + values + ")";

/*修改SQL*/
sql = "update EKECMS_EKETEAM set ZDMJ=‘" + Request.Form["h1"].ToString() + "‘";
sql += ",jglx=‘" + Request.Form["h2"].ToString() + "‘";
sql +=" where pid in (" + Request.Form["id"].ToString() + ")";

asp.net(C#)写SQL语句技巧

标签:style   color   os   for   sp   c   sql   r   .net   

原文地址:http://www.cnblogs.com/eketeam/p/3972737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!