I have an edit page that is able to edit administrators of a site, on reload or edit of the admin I need to load the name in the autocomplete box and then disable so they cannot change it on edit. Problem is I can seem to figure out how to reload the autocompletebox with the text.
myDataTable = New DataTable
myDataTable = getReader(sql)
If myDataTable.Rows.Count > 0 Then
HFAdminId.Value = myDataTable.Rows(0)(0)
txtItemSearch.Text = myDataTable.Rows(0)(0).ToString()
ddlLocations.SelectedValue = myDataTable.Rows(0)(2)
End If
Also tried this but to no avail.
myDataTable = New DataTable
myDataTable = getReader(sql)
If myDataTable.Rows.Count > 0 Then
HFAdminId.Value = myDataTable.Rows(0)(0)
txtItemSearch.Entries(0).Text = myDataTable.Rows(0)(1).ToString
ddlLocations.SelectedValue = myDataTable.Rows(0)(2)
end if
Both gave me this error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error: