none
How to pull all table from database using entity framework. RRS feed

Answers

  • Hi Risu Raj,

    If you need to know what tables are present in an EF model(Database). please refer to the following link.

    What tables are in my EF model? And my Database?

    If you want to retrieve all the records from a Data table, please refer to the following code.

    using (var db = new EFDemoContext())
    {
        var query = db.TestTable1s.ToList();
        //this.dataGridView1.DataSource = query;
    }

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 1, 2017 9:30 AM
    Moderator

All replies

  • Hi Risu Raj,

    If you need to know what tables are present in an EF model(Database). please refer to the following link.

    What tables are in my EF model? And my Database?

    If you want to retrieve all the records from a Data table, please refer to the following code.

    using (var db = new EFDemoContext())
    {
        var query = db.TestTable1s.ToList();
        //this.dataGridView1.DataSource = query;
    }

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 1, 2017 9:30 AM
    Moderator

  • If you need to know what tables are present in an EF model(Database). please refer to the following link.

    If you want to retrieve all the records from a Data table, please refer to the following code.

    using (var db = new EFDemoContext())
    {
        var query = db.TestTable1s.ToList();
        //this.dataGridView1.DataSource = query;
    }
    Can you please explain overall process.
    Friday, December 1, 2017 11:35 AM
  • Hi Risu Raj,

    >>Can you please explain overall process.

    The following document provide a complete steps for your reference.

    https://msdn.microsoft.com/en-us/library/jj200620(v=vs.113).aspx

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 4, 2017 1:13 AM
    Moderator