refresh context
-
hi all, well, after insert one record in one table , im going to refresh datagrid in order to user could see the result, i used this :
Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, Context.TableName);
this.BindingSource.DataSource = Context.TableName;
dataGridViewX1.DataSource = BindingSource ;
alarmBindingSource.ResetBindings(true);but there is no chance to see the inserted row! exepts renewing DataContext which spends long time! plz help
-
hi all, well, after insert one record in one table , im going to refresh datagrid in order to user could see the result, i used this :
Context.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, Context.TableName);
this.BindingSource.DataSource = Context.TableName;
dataGridViewX1.DataSource = BindingSource ;
alarmBindingSource.ResetBindings(true);but there is no chance to see the inserted row! exepts renewing DataContext which spends long time! plz help
Have you tried to add the new record using the binding source. In that case the record should appear automatically in the datagrid, then accept changes in context and it should be written to database too.