Suscribe event of deleted in a datatable

P

Paul

Hi,
I created a Dataset with Wizard of visual studio 2008 from a database.
I want to subscribe to the event of removal of a table, but can not.
Any ideas?

Thanks
 
A

Alberto Poblacion

Paul said:
I created a Dataset with Wizard of visual studio 2008 from a database.
I want to subscribe to the event of removal of a table, but can not.

DataSet ds = new MyDataSet();
ds.Tables.CollectionChanged += new
CollectionChangeEventHandler(myEventHandler);
....

private void myEventHandler(object sender, CollectionChangeEventArgs e)
{
if (e.Action==CollectionChangeAction.Remove)
{
//Insert code here
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top