How to get index of Selection row in a datatable

Mayhem51

New Member
How to get the Index of a Selected Row in a Dataset or Dataview<BR><BR>Dim objTable as DataTable = objDataSet.Table("Books")<BR><BR>Dim objRow() as DataRow<BR><BR>objRow = objTable.Select("FirstName='Margaret'") 'Find the Row we want<BR><BR>ObjRow(0).Item("FirstName") = "John"<BR>objRow(0).Item("Address") = "12 Orchard Road"<BR><BR>---------------------------------------------------------------<BR><BR>To get the index of a SortedList or HashTable<BR><BR>dvINDEXNO = hsTABLE.IndexOfKey(Trim(dvSTATENAME)) 'Must Trim if from DropDownList<BR><BR>To get Index of ArrayList<BR><BR>dvINDEXNO = arArray.IndexOf(dvSTATENAME)
 
Back
Top