开发者

Updating Bound LINQ to Entities DataSource

开发者 https://www.devze.com 2023-02-01 20:09 出处:网络
OK, so I am learning the Entity Framework and LINQ to connect to a remote MySQL database using the MySQL ADO .NET Connector.

OK, so I am learning the Entity Framework and LINQ to connect to a remote MySQL database using the MySQL ADO .NET Connector.

I have set up my Entity Data Model previously. Now, I'll use a lambda expression to grab a list of all the van objects from the data store and bind the results to a grid view:

dataEntities db = new dataEntities();

var vans = from v in db.vans
   select v;

gridControl1.DataSource = vans;

That works very well. However, when the data in the remote store changes, I'd like to update the grid view without having to execute the above code again. What would be the correct way to handle开发者_如何学Python this? I realize that I would move the db object to a module or other global scope, but how would I update the vans object in a later event, say a button press?


Try to do something equal to thess articles - http://www.devart.com/linqconnect/docs/ASPNetBinding.html or http://www.devart.com/linqconnect/docs/WinFormsBinding.html.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号