a.aspx?sn=636E7168-3EE8-440D-A5C9-F02760F2527D
代码:
string sn = this.Request.QueryString["sn"].ToString();
string sql = "select * from KO_SignOn where CheckID="+sn;
int a =Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.connectionString,CommandType.Text,sql));
if(a==1)
{
          string str="update KO_SignOn set IsPassed=1 where CheckID="+sn;
DbHelperSQL.Query(str);
return true;
}
else
{
return false;
}
错误 :Server Error in '/' Application.
--------------------------------------------------------------------------------浮点值 '636E7168' 超出了计算机表示范围(8 字节)。 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: 浮点值 '636E7168' 超出了计算机表示范围(8 字节)。表中,CheckID不是主键帮忙看看,谢谢!

解决方案 »

  1.   

    string sql = "select * from KO_SignOn where CheckID= '" + sn + "'";
      

  2.   

    你的sql 语句是错误的。636E7168-3EE8-440D-A5C9-F02760F2527D不是数字型的,要加''
      

  3.   

    孟老大,照你改的
    string sql = "select * from KO_SignOn where CheckID= '" + sn + "'";就select不到东西了
      

  4.   

    你的checkid类型是什么,然后查看
    string sn = this.Request.QueryString["sn"].ToString();
    之后,sn具体的数据是什么。
      

  5.   

    多谢各位,搞定了,SqlParameter[] parameters = {
    new SqlParameter("@CheckID", SqlDbType.UniqueIdentifier)
    };
    parameters[0].Value = id;
    string sql = "select *  from KO_SignOn where CheckID= @CheckID";
    int a  =Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.connectionString,CommandType.Text,sql,parameters));
    if(a==0)
    {
    return false;
    }
    else
    {
    string str="update KO_SignOn set IsPassed=1 where CheckID=@CheckID";
    SqlHelper.ExecuteNonQuery(SqlHelper.connectionString,CommandType.Text,str,parameters);
    return true;
    }
      

  6.   

    做一个注册系统,完工以后老板让加一邮件验证,想想guid最省事,不会重复,就在后面加了个bit,的ispassed和guid的列,就是这样子.
    int a  =Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.connectionString,CommandType.Text,sql,parameters));
    这个地方反回值不只是0或1,有时候是9很郁闷,先不管了吧,是0就return个false算了,update不会错.