mailboxid = myReader.GetInt16(0);

解决方案 »

  1.   

    改成mailboxid = myReader.GetInt16(0);
      

  2.   

    mailboxid = myReader.GetInt16(0);
      

  3.   

    都知道了,我也不说了,
    我想说的呢是:你可以把ex.message改成ex.tostring,当出现错误时,你可以看到是哪一行出错了。
      

  4.   

    mailboxid = myReader.GetInt16(1);===>mailboxid = myReader.GetInt16(0);因为你只Sess
      

  5.   

    改过了。谢谢大家!可运行的时候还是提示变成:
    指定的转换无效我用的C#。Sql语句有问题吗?
    把max去掉了就成功了。可我要取最大值
      

  6.   

    数据库里mailboxid是什么类型,如果是int
    mailboxid = myReader.GetInt32(0);
      

  7.   

    Response.Write("  当前id  "+mailboxid(.)ToString()+"   ");
    这里你改过来了吗?
      

  8.   

    use :  mailboxid = myReader.GetInt32(0);
      

  9.   

    mailboxid = myReader.GetInt16(0);