use*_*466 1 sql asp.net datatable
txtAddress.Text = DB.ProfileDataset.Tables("tblCustomers").Rows.Item("Address").toString
Run Code Online (Sandbox Code Playgroud)
上面的代码生成Option Strict On禁止在Item("Address")下从'String'到'Integer'错误的隐式转换 我不知道我做错了什么...
该DataRowCollection.Item财产需要行索引的整数.
我认为你遵循以下语法:
txtAddress.Text = DB.ProfileDataset.Tables("tblCustomers").Rows(0)("Address").ToString()
Run Code Online (Sandbox Code Playgroud)
编辑
要记住的事情:
original code
= DB.ProfileDataset.Tables("tblCustomers").Rows.Item("Address").toString
compiler sees
= DB.ProfileDataset.Tables.Item("tblCustomers").Rows.Item("Address").toString
fixed code
= DB.ProfileDataset.Tables("tblCustomers").Rows(0)("Address").ToString()
compiler sees
= DB.ProfileDataset.Tables.Item("tblCustomers").Rows.Item(0).Item("Address").ToString()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2442 次 |
| 最近记录: |