How to delete all data in sql in one click?
This is most likely related with my pending question which is now still searching for the solution. The XAML.cs here are as follows
private void btndelete_Click(object sender, RoutedEventArgs e)
objctx = new StudentDomainContext();
var query = objctx.GetStudentsQuery();
objctx.Load(query, Datadelete, null);
private void Datadelete(LoadOperation<student> lo)
student st = lo.Entities.First();
catch (Exception ex)
MessageBox.Show("Data deletion failed" +ex.Message);
The Class query are as follos......
public IQueryable<student> GetStudents()
The codes are working but when I execute, only one data will be deleted. What I want here is to delete all datas inside my database concerning student Table. Please Help!