2010-02-06 47 views

回答

5

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()