Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: TypeCasting aDataList.DataSource to a DataTable


Message #1 by "Soha Sobhy" <zee_alien@h...> on Thu, 6 Feb 2003 13:51:26
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.

  Return to Index