what is the best and efficient way to show mixed tables in c# winform?

Farshad Valizade 381 Reputation points
2024-01-24T13:16:07.1966667+00:00

Hi every body.

I work in database first projects and I make store procedure to show relational tables.mix 10-11 tables together and fetch it from the database with ado.net datareader and put it in a datatable and put this datatable in data source of a data grid view and show it to the end user.

in the DataGridview_CellClick I have written : txtSubject.Text = DG_Contract.Rows[e.RowIndex].Cells["contract_subject"].Value.ToString(); and rest of fields.

every thing is manual and it get s my time to make a DAL file and BLL File and View and Datagridview Click and convert fields and ...

Is every db projects do this rules?

Is there any simple way to bind data and edit update and delete this data from grid view?

Is that way that I mix tables and put that query in a store procedure and show to user is right way?

Last Question :

What does master database programmers make their applictions?

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
700 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,438 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,850 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,356 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wenbin Geng 711 Reputation points Microsoft Vendor
    2024-01-25T10:03:56.1933333+00:00

    Hi @Farshad Valizade , Welcome to Microsoft Q&A.

    For the first issue:

    You can use some ORM frameworks to help you write more efficient and maintainable code. If it is for C# and Winforms, EntityFrameWork Core is for you The only choice. Using Entity Framework, you can generate classes that represent database tables and use LINQ to query and manipulate the data. This saves a lot of time and effort compared to writing your own data access layer and business logic.

    For the second issue:

    There are easier ways to bind data to the DataGridView and handle user interaction. For example, you can use data binding to automatically populate data from a database table or query data. You can also use the DataGridView's built-in editing and validation capabilities to allow users to edit and delete data.

    For the third issue:

    There are many various tools and techniques used by master database programmers. Some of the most popular tools and frameworks include Microsoft SQL Server, Oracle Database, MySQL, PostgreSQL, and MongoDB.

    If you are using Winforms, I still recommend you to use Microsoft SQL Server. Microsoft SQL Server has better compatibility with Winforms and has richer nuget packages to use.

    Best Regards,

    Wenbin

    ---If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful