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
我之前一直是在word里设计好表格内容后再手动创建在SQL中,最后甚至是把数据库实例导入到visual studio中我的项目里,您的做法令我眼前一亮,我心里不停重复:“That's magic. That's magic....”太感谢了!!!看您的视频我能学到很多新知识和新方法,对于我这样的小白也太友好了!!
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.
Wow. This was brilliant. And it is one of the most treasured videos for me. Thank you
Thank you very much! Hello from Russia:D
thank you sir ,it was very helpful
Thank you for the example, it was very helpful.
But can we reach the data in xaml code using data binding?
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
can i insert data to the sql server if i use this method?
yes you can, you just need update the connection string to server , Remote or Local both will work
Can we use SqlLite together with data grid instead of sql server?
Yes it can work you just need to change the entity framework provider from SQL server to SQL light
You can take a look at this video where I read data from an SQLite database ruclips.net/video/fnyiDMvhJOc/видео.html
Hi. could you please share your XAML code so i can understand how to setup and design the DataGrid? Thank you.
Alright sure
Here is the Source Code git.io/J6oXK
@@TacticDevs thank you so much. Have a good day
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,
Sure I will share the link soon
here is the source code git.io/JD9P0
Why DataGrid too slow rendering?
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
@@TacticDevs and be more faster as excel?
@@user-gh2ml3cf5o yes
@@TacticDevs ok, thanks. Coud you give a link on video where people show examples of that?