How to...

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

How to...

Post by Zero-G. » Thu 02 Dec 2010 12:26

Hey
Using your latest dotConnect for MySQL components of Version (5.80)

I do have the following situation:
I use Master-Detail tables to display the data of my articles.
As example: Master table holds Article and ID, Detail holds MastersID and Stock

In my grid, I bind my articles like:
BindingSource.DataSource = From Articles in myDataContext.Article
Grid.DataSource = BindingSource

I use defered loading. - so, when the user clicks on the article, on a second grid, the stock of the article is displayed.

GridDetail.DataSource = DirectCast(BindingSource.Current, myDataContext.Article).Details

My question now is: When a user user sells the article, then the stock isn't up to date anymore. - So I have to refresh my data.
How to do so?

THX

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Tue 07 Dec 2010 12:37

To apply the changes made in your grids to the database, you need to execute the SubmitChanges method of your DataContext instance. For example, you can do it when the list of the binding source changes:

Code: Select all

private void bindingSource1_ListChanged(object sender, ListChangedEventArgs e) {
	myDataContext.SubmitChanges();
}
Please tell us if you are encountering any problems with this. If you are, please specify the scenario in which they occur.

Zero-G.
Posts: 398
Joined: Sat 09 Dec 2006 12:20

Post by Zero-G. » Tue 07 Dec 2010 12:47

Thx!

Post Reply