如题,真有些奇怪
Convent.toInt32("1.00")出现同样的错误

解决方案 »

  1.   

    Convent.toInt32(string value)
    这个方法中的value:包含要转换为数字的string.String,所以"1.00"这个参数的格式不正确,详情看看MSDN
    所以如果是Convent.toInt32("1111") 就可以
      

  2.   

    Convent.toInt32()这个方法有16个重载,每个方法都对应不用的参数(格式),用的时候要注意 
      

  3.   

    说的再明白点,1.00是double,如果LZ想转,Convent.toInt32(double value)
    比如: Convent.toInt32(1.00)
      

  4.   

    Convent.toInt32("里面必须是Int32的字符串格式")
      

  5.   

    Convert.ToInt32() 则可以将多种类型(包括 object  引用类型)的值转换为 int  类型
      

  6.   

    double d=1.00;
    在转化
    string为整形
      

  7.   

    问题是从数据库查询出来的是字符串形式"1.00",怎么转化“里面必须是Int32的字符串格式”呢
      

  8.   

    恩, double to int。
      

  9.   

    Convent.toInt32("里面必须是Int32的字符串格式")
    如果查出来是1.00,那就截取吧,呵呵
                string ss = "12345.000";
              MessageBox.Show(ss.Substring(0, ss.IndexOf(".")));
      

  10.   

    我估计我懂了,先转化成double,再由double 转化成int
      

  11.   

    先转化为double 在转化为int