11 2011 档案
摘要:首先:不防SQL注入 int Id =1; string Name="lui"; cmd.CommandText="insert into TUserLogin values("+Id+",'"+Name+"')"; 因为Id是数值,所以在传递的时候只需要在sql字符串中用"+Id+"即可实现,而N...
阅读全文
摘要:红颜色的为重要代码 SqlConnection con = DBCommon.GetSqlConnection();//SqlCommand cmd = con.CreateCommand();//创建存储过程SqlCommand cmd = new SqlCommand("Sp_drugStock...
阅读全文
摘要:一般是这样的,如果用设计器将SqlDataAdapter拖到页面中使用时,不会出现SqlDataAdapter.Update(ds)更新时出错情况,因为系统会自动生成SqlDataAdapter的属性命令,比如:.UpdateCommane insertCommand selectCommand...
阅读全文