要怎么样才能实现“System.Type”转换为“string”?

解决方案 »

  1.   

    System.Type.GetType().ToString()
    ??
      

  2.   

    string dx = Convert.Tostring(textBox1);
     dx = dt.Rows[0][4].GetType(); //无法将类型“System.Type”隐式转换为“string”
    就是这样,不知道要怎么转换
    我是想把输入上去的数字存入到表上面.
      

  3.   

    不知LZ要做什么?
    要验证类型的话可参考:
    TextBox txtName;
    if(txtName.GetType() == typeof(TextBox))
    {
    }
      

  4.   

    dt.Rows[0][4].Value = (object)dx;
      

  5.   

    更正一下:
    dt.Rows[0].Cells[4].Value = (object)dx;
      

  6.   

    我写的代码可能高手们看不明白,(因为我是菜鸟,想当然的写的)
    我想实现就是,我再TEXTBOX上输入一个数字,然后保存到表上[0][4]的位置,不知道该怎么写?
      

  7.   


    string dx = textBox1.text.trim(); 
    dt.Rows[0][4]=dx;
      

  8.   

    string dx = textBox1.text.trim(); 
    dt.Rows[0][4]=dx;
    这样多简单啊