开发者

LINQ datasource and BindingNavigator update deosn't work

I'm trying to set a LINQ query as the DataSource of a BindingNavigator control.

开发者_开发百科In the form's variables I added a data context:

`Private c

tx As New myDataManagerDataContext`

The following code allows me to display and navigate through the results:

Dim clubList = From c In ctx.clubs _
                   Select c

BindingNavigator1.BindingSource.DataSource = clubList

Each record is displayed nicely so far. In the Winform, all textboxes are duly binded to the datasource but my problem is:

I added a Save ToolboxButton with: ctx.SubmitChanges()

But it doesn't process any update!

Question: Do I HAVE to write a complete Insert/ Update Linq procedure in the Save button?

Like:

Dim newClub as new DataContext.Club newClub.Name = NameTextBox.Text newClub.Address.... Etc.


Try to call EndEdit on binding source just before save operation to happen.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜