Load Data to a DataGrid in WPF With MSSQL And EntityFramework in C#

Поделиться
HTML-код
  • Опубликовано: 6 сен 2021
  • #EntityFramework #DataGrid
    In this video I show you step by step on how you can read data from
    Microsoft SQL Server using EntityFramework then display the data in a
    DataGrid control
    GitHub Source Code:
    git.io/J6oXK

Комментарии • 24

  • @ovossr
    @ovossr Месяц назад

    我之前一直是在word里设计好表格内容后再手动创建在SQL中,最后甚至是把数据库实例导入到visual studio中我的项目里,您的做法令我眼前一亮,我心里不停重复:“That's magic. That's magic....”太感谢了!!!看您的视频我能学到很多新知识和新方法,对于我这样的小白也太友好了!!

  • @hoangtrungsia2010
    @hoangtrungsia2010 Год назад +1

    Thank you for the excellent, straightforward tutorial. This deserves more view.
    Note: If your table does not have any primary keys, enable protected override void OnModelCreating(ModelBuilder modelBuilder). Don't delete that part like on the video.

  • @standman007
    @standman007 4 месяца назад

    Wow. This was brilliant. And it is one of the most treasured videos for me. Thank you

  • @sh4raga450
    @sh4raga450 2 года назад

    Thank you very much! Hello from Russia:D

  • @sirinebibicha2024
    @sirinebibicha2024 Год назад

    thank you sir ,it was very helpful

  • @muhammedmercan7910
    @muhammedmercan7910 2 года назад +1

    Thank you for the example, it was very helpful.
    But can we reach the data in xaml code using data binding?

    • @TacticDevs
      @TacticDevs  2 года назад

      Yes you can bind the data by using the data context property or a user defined property like in this case you can bind it to the My employees list property , So on the datagrids item source property you can simply define a binding attribute and specify the source

  • @nickolajrasmussen8996
    @nickolajrasmussen8996 Год назад

    can i insert data to the sql server if i use this method?

    • @TacticDevs
      @TacticDevs  Год назад

      yes you can, you just need update the connection string to server , Remote or Local both will work

  • @nikolamaksimovic2367
    @nikolamaksimovic2367 2 года назад

    Can we use SqlLite together with data grid instead of sql server?

    • @TacticDevs
      @TacticDevs  2 года назад

      Yes it can work you just need to change the entity framework provider from SQL server to SQL light

    • @TacticDevs
      @TacticDevs  2 года назад +1

      You can take a look at this video where I read data from an SQLite database ruclips.net/video/fnyiDMvhJOc/видео.html

  • @muzamilmehmood1398
    @muzamilmehmood1398 2 года назад

    Hi. could you please share your XAML code so i can understand how to setup and design the DataGrid? Thank you.

  • @a.daubercy9784
    @a.daubercy9784 2 года назад

    Hi,
    I am new to C# WPF.
    Created a window with a listview menu in it.
    Depending on the choice, this opens a certain UserControl screen, in one of these it opens a personnel list in a DBGrid and this without any problems.
    But my next step is if I double click on a selected row of DBGrid , it should show a new screen with all the details of the person and the ability to execute (CRUD),
    on closing I return to my DBGrid !!!
    Note, my CRUD buttons are on another bottom menu bar that is also used for any other usercontrol screens!!
    Is it possible to have the source code of your video "Page Navigation in WPF Using a Frame Control in C#"
    With best regards,

    • @TacticDevs
      @TacticDevs  2 года назад

      Sure I will share the link soon

    • @TacticDevs
      @TacticDevs  2 года назад

      here is the source code git.io/JD9P0

  • @user-gh2ml3cf5o
    @user-gh2ml3cf5o 2 дня назад

    Why DataGrid too slow rendering?

    • @TacticDevs
      @TacticDevs  23 часа назад +1

      The reason it’s slow is because we load the entire document but we can implement visualization Where are we load the visible data only

    • @user-gh2ml3cf5o
      @user-gh2ml3cf5o 19 часов назад

      @@TacticDevs and be more faster as excel?

    • @TacticDevs
      @TacticDevs  18 часов назад +1

      @@user-gh2ml3cf5o yes

    • @user-gh2ml3cf5o
      @user-gh2ml3cf5o 5 часов назад

      @@TacticDevs ok, thanks. Coud you give a link on video where people show examples of that?