Loading Data from Multiple Tables into Data Grid using Entity Framework

To load data from multiple SQL tables into a C# data grid view you must first create a view in SQL which you will then add to your model. Once created, using entity framework in Visual Studio’s IDE you can call the data-set to load data into your data grid view.

Step 1 : In Microsoft SQL Server Management Studio Object Explorer right click on your view folder and select new view. Add the tables you want to pull data from and save the view in SQL.

 

 

Step 2 : In Visual Studio IDE go to your Model.edmx and right click then select update model from database. Select the view from the update wizard and click finish.

 

 

Step 3 : From Visual Studio IDE select a datagrid component, add it to your form then on the top right corner click on select datasource. Find the Datasource , select it and it will be loaded on the data grid component on your form.

create new view in sql
Right Click on Views Folder Icon and select new view
Visual Studio 2015 Update Wizard
Insert SQL View into Model in Visual Studio IDE
Select View as DataSource
Step 3 : Select Data source

Leave a Reply

No apps configured. Please contact your administrator.

How to code your own sFTP File Uploader Windows application using C# and SSH

Creating your own SFTP application is now easier than ever. Using C# allows you to easily create a windows application to securely transfer your files. SFTP stands for SSH File Transfer Protocol. SSH is an encrypted and secure communication protocol

ArcMap 10.4 – Using python function in field calculator to update date values from another column

Total Page Visits: 2407 – Today Page Visits: 1

XLS to DBF File Conversion using ExcelDataReader

ExcelDataReader is a lightweight and fast library written in C# for reading Microsoft Excel files (2.0-2007). Below is code that will read an xls file, skip the headers and write data in DBF format.

Total Page Visits: 2407 - Today Page Visits: 1