1
txtAddress.Text = DB.ProfileDataset.Tables("tblCustomers").Rows.Item("Address").toString
上面的代码生成的选项严格在隐式转换不允许下项从“字符串”到“整数”错误的隐式转换(“地址”) 我不知道我做错了什么...选项严格On不允许从“字符串”到“整数”
txtAddress.Text = DB.ProfileDataset.Tables("tblCustomers").Rows.Item("Address").toString
上面的代码生成的选项严格在隐式转换不允许下项从“字符串”到“整数”错误的隐式转换(“地址”) 我不知道我做错了什么...选项严格On不允许从“字符串”到“整数”
DataRowCollection.Item属性需要一个整数用于行索引。
我觉得你的语法如下之后:
txtAddress.Text = DB.ProfileDataset.Tables("tblCustomers").Rows(0)("Address").ToString()
编辑
东西要记住:
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()