How to get Linq object with intellisence from the current SQLce datarow via bindingnavigator? RRS feed

  • Question

  • I have a CRUD application which was built as a windows form under Visual Basic in Visual Studio 2008.  The form uses a bindingnavigator, bindingsource, and tableadapter to maintain a data table in a SQLce database.  The windows form class is Linq-enabled (it has dbml O/R mapping available), but I have not yet declared a datacontext to use the Linq features. 

    I would like to do some custom data manipulation on the current record which is displayed on the screen, and would like to have access to strongly-typed Linq-style intellisense (rc.Address, rc.City, rc.Zip, etc) rather than referencing into the cells collection of a datarow object (db.rows(currentRow).cells("City")).  I do not need to access any other records in the data table, or manipulate the position of the current record pointer as handled by the navigator control. 

    What is the best way to do this and get column intellisense on the object I want to create from the current datarow?  So far, I have created a data object for the current row, but don't know how to populate it:

         Dim rc as new rentComp      'schema for object from rentComps data table and rentComp class (Linq)
         rc = ......... ?

    Do I populate the rc object through the bindingnavigator, bindingsource, or datatable? 

    Thanks, -BGood
    Wednesday, April 1, 2009 4:01 PM

All replies