Linq2SQL or EntityFramework and databinding

Posted by rene marxis on Stack Overflow See other posts from Stack Overflow or by rene marxis
Published on 2012-09-29T08:35:09Z Indexed on 2012/09/29 9:37 UTC
Read the original article Hit count: 188

is there some way to do databinding with linq2SQL or EntityFramework using "typed links" to the bound property?

Public Class Form1

    Dim db As New MESDBEntities 'datacontext/ObjectContext
    Dim bs As New BindingSource

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        bs.DataSource = (From m In db.PROB_GROUP Select m)
        grid.DataSource = bs
        TextBox1.DataBindings.Add("Text", bs, "PGR_NAME")
        TextBox1.DataBindings.Add("Text", bs, db.PROB_GROUP) '**<--- Somthing like this**
    End Sub
End Class

I'd like to have type checking when compiling and the model changed.

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about entity-framework