2010-02-06 91 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()