Display Data to DataGridView from ORM

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thesti
    New Member
    • Nov 2007
    • 144

    Display Data to DataGridView from ORM

    hello,

    i usually simply use DataAdapter or DataReader to get data from database.now, i'm thinking to use ORM to help ease OO development.

    but then because i have the need to display the data in a DataGridView, filling query result to a DataTable from a DataAdapter is simple enough. i don't know if it's better to use ORM or not.

    is filling data generated from ORM to a DataGridView is simple enough? if the ORM framework used is NHibernate for example.

    Thank you.
  • jfputnam
    New Member
    • Dec 2009
    • 1

    #2
    Yes for simple mappings, something like

    Dim myQuery As IQuery = session.CreateQ uery("from DB_Account where MTC_Account_Num ber = :acctNum")
    myQuery.SetPara meter("acctNum" , acctNum)
    usersDV.DataSou rce = myQuery.List()
    usersDV.DataBin d()


    You can use an IList as the datasource.

    Comment

    Working...