菜菜紧急求救

cwb210 2008-07-03 10:33:24
要怎么样才能实现“System.Type”转换为“string”?
...全文
85 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
cwb210 2008-07-03
  • 打赏
  • 举报
回复
不会==很难啊!!!
pinhailinfeng 2008-07-03
  • 打赏
  • 举报
回复
string dx = textBox1.text.trim();
dt.Rows[0][4]=dx;
这样多简单啊。。。。。。
cwb210 2008-07-03
  • 打赏
  • 举报
回复
谢谢各位大大....
etherealkite 2008-07-03
  • 打赏
  • 举报
回复

string dx = textBox1.text.trim();
dt.Rows[0][4]=dx;
cwb210 2008-07-03
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 smntbk 的回复:]
不知LZ要做什么?

[/Quote]
我写的代码可能高手们看不明白,(因为我是菜鸟,想当然的写的)
我想实现就是,我再TEXTBOX上输入一个数字,然后保存到表上[0][4]的位置,不知道该怎么写?
smntbk 2008-07-03
  • 打赏
  • 举报
回复
更正一下:
dt.Rows[0].Cells[4].Value = (object)dx;
smntbk 2008-07-03
  • 打赏
  • 举报
回复
dt.Rows[0][4].Value = (object)dx;
smntbk 2008-07-03
  • 打赏
  • 举报
回复
不知LZ要做什么?
要验证类型的话可参考:
TextBox txtName;
if(txtName.GetType() == typeof(TextBox))
{
}
cwb210 2008-07-03
  • 打赏
  • 举报
回复
string dx = Convert.Tostring(textBox1);
dx = dt.Rows[0][4].GetType(); //无法将类型“System.Type”隐式转换为“string”
就是这样,不知道要怎么转换
我是想把输入上去的数字存入到表上面.
ws_hgo 2008-07-03
  • 打赏
  • 举报
回复
typeof(xxx).ToString()
nihaimeiyoudenglu 2008-07-03
  • 打赏
  • 举报
回复
tostring()
眼里进了砂 2008-07-03
  • 打赏
  • 举报
回复
typeof(xxx).ToString()
etherealkite 2008-07-03
  • 打赏
  • 举报
回复
System.Type.GetType().ToString()

??
mathieuxiao 2008-07-03
  • 打赏
  • 举报
回复
可否说得详细一点

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧