日期:2014-05-17  浏览次数:20479 次

“System.Data.dll”类型的异常 高手来
string sql2 = "update [WebGameUserDB].[dbo].[saving_card_number] set state= a where saving_card_pwd='" + cardPwd + "')"; 在 System.Data.SqlClient.SqlException 中第一次偶然出现的“System.Data.dll”类型的异常

怎么看SQL2也没写错啊。。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using DBExcute;

namespace xiyangyang
{
  public partial class chongzhicard : System.Web.UI.Page
  {
  protected void Page_Load(object sender, EventArgs e)
  {
  AjaxPro.Utility.RegisterTypeForAjax(typeof(chongzhicard)); 
  }
  [AjaxPro.AjaxMethod]
  public int checkCode(string code)
  {
  if (code == Session["checkCode"].ToString())
  {
  return 0;
  }
  else
  {
  return 1;
  }
  }
  [AjaxPro.AjaxMethod]
  public int checkRegName(string regName)
  {
  string strCheckRegName = "select count(*) from [QPGameUserDB].[dbo].[AccountsInfo] where Accounts ='" + regName + "'";

  return DataBaseSql.RunExecuteScalar(strCheckRegName);

  }
  [AjaxPro.AjaxMethod]
  public int CardChongZhi(string userName, string cardId, string cardPwd)
  {
  SqlParameter[] paras ={ new SqlParameter("@cardnumber", SqlDbType.VarChar,100),
  new SqlParameter("@cardpwd",SqlDbType.VarChar,100)
   

  };
  paras[0].Value = cardId;
  paras[1].Value = cardPwd;
  int checkCard = DBExcute.DataBase.RunExecuteScalar("Check_Card_Use_Status", paras);
  if (checkCard == 4)
  {
  DataBLL.Filter filter = new DataBLL.Filter();
  DataTable dt = filter.GetParas();
  int bili = Convert.ToInt32(dt.Rows[0]["setBili"].ToString());
  int SetSendBili = Convert.ToInt32(dt.Rows[0]["SetSendBili"]);
  int money = Convert.ToInt32(dt.Rows[0]["setSendMoney"]);
  SqlParameter[] chongzhiparas ={
  new SqlParameter("@cardnumber", SqlDbType.VarChar,100),
  new SqlParameter("@cardpwd", SqlDbType.VarChar,100),
  new SqlParameter("@username", SqlDbType.VarChar,100),
  new SqlParameter("@time",DateTime.Now),
  new SqlParameter("@bili",bili)
  };

  chongzhiparas[0].Value = cardId;
  chongzhiparas[1].Value = cardPwd;
  chongzhiparas[2].Value = userName;

  string sql = "select saving_card_type from [WebGameUserDB].[dbo].[saving_card_type] where saving_card_type_id in (select saving_card_type from [WebGameUserDB].[dbo].[saving_card_number] where saving_card_number='" + cardId +