views:

301

answers:

2

i write this code in my project:

        DatabaseDataContext dataContext = new DatabaseDataContext();

        IQueryable<Available_Time_Teacher> att = from r in dataContext.Available_Time_Teachers
                                                 where r.Teacher_ID == id
                                                 select r;            
        dataGrid1.ItemsSource = att;

when i change in tables in datagrid how the change can submit on database.

+1  A: 

If what you want is to save your changes to the database, then you need to call

dataContex.SubmitChanges();

Every item that was changed at the datagrid will be saved to the database.

Kiranu
A: 

thanks it works well when i write it in button