aspx_beginners thread: TypeCasting aDataList.DataSource to a DataTable
I wanted to delete an item from the datalist so i used the following lines: DataTable aTable = (DataTable)DataList1.DataSource; aTable.Rows[DataList1.SelectedIndex].Delete(); The first line got me an exception saying "Specified cast is not valid." The weird thing is that I got that line right out of the MSDN Library so I can't see how this could be wrong. Could anyone help me with that, please? Thanks in advance.
|





