check the datatype:Console.WriteLine(my_Ds.Tables[0].Rows[2][1].GetType().Name);ora=Convert.ToSingle(my_Ds.Tables[0].Rows[2][1].ToString());

解决方案 »

  1.   

    如果存在一个databasePath.Text=(Convert.ToDouble( my_Ds.Tables[0].Rows[0][0].ToString())).ToString();如果my_Ds.Tables[0].Rows[2][1]=0.932443213;
    那显示出来的结果是1  会丢失数据,为什么?
    3x
      

  2.   

    what isdatabasePath.Text= my_Ds.Tables[0].Rows[2][1].ToString();?
      

  3.   

    what isdatabasePath.Text= my_Ds.Tables[0].Rows[2][1].ToString();?
    ~~~~~~~~~~~~~~~~~~~
    就是我要将my_Ds.Tables[0].Rows[2][1]的值在一个TextBox中显示出来,
    如果存在一个databasePath.Text=(Convert.ToDouble( my_Ds.Tables[0].Rows[0][0].ToString())).ToString();如果my_Ds.Tables[0].Rows[2][1]=0.932443213;
    那显示出来的结果是1  会丢失数据,为什么?
      

  4.   

    不懂你的意思,databasePath.Text=(Convert.ToDouble( my_Ds.Tables[0].Rows[0][0].ToString())).ToString();
    ----------------------------------------------- >  这里是[0][0]
    如果my_Ds.Tables[0].Rows[2][1]=0.932443213;
    --------------->  这里是[2][1]如果是databasePath.Text=my_Ds.Tables[0].Rows[2][1].ToString();显示结果是什么?
      

  5.   

    直接:databasePath.Text=(Convert.ToDouble(my_Ds.Tables[0].Rows[2][1])).ToString("f5");
    f5就是显示小数点后面的5位!
      

  6.   

    float a;
    a=float.Parse(my_Ds.Tables[0].Rows[2][1]) + 1;