2014-02-12 72 views

回答

2

试试这个:

txtVendorFAX.Text = daPo.Tables("vendor").Rows(i).Item(3) 
1
txtVendorFAX.Text = daPo.Tables("vendor").Rows(i).Item(3) 
0

使用文本框的.Text财产使用下面的代码

txtVendorFAX.Text = daPo.Tables("vendor").Rows(i).Item(3) 

一文本框是Textbox,而不是一个字符串。这就是为什么你所得到的错误 Unable to cast object of type 'System.String' to type 'System.Windows.Forms.TextBox

1

试试这个:

txtVendorFAX.Text = Convert.ToString(daPo.Tables( “卖方”)行(I).Item(3))

+0

没有人写过Convert.ToString()。你写了没有右括号的.ToString。另外,通过编写Convert.Tostring比最终的.ToString更具优势,因为如果incase的值为空,那么有时会出错。但是Convert.Tostring()会给出string.empty的值。 – Aditi

+0

以上评论是针对马特威尔科先生的,因为他对我的评论给予了否定的评价,即使在对我自己的评论进行辩护之后。 – Aditi

相关问题