I am creating a tool to store the data displayed in DataGridView in the database of SQLserver.
By the way, I tried TableAdapter, but I was not sure about it halfway, so I was frustrated.
Also, some of the reference sites take data from the database once, input it into DataGridView, and store the edited DataGridView in the database, but there are many ways to store the existing DataGridView in the database. Is n’t it? Please teach me.
This is the site that I used as a reference.
Answer # 1
Articles 1 to 3 that are referenced seem to work by writing code with a considerable amount of self-help, but if you want to create an app with a standard configuration using the wizard of Visual Studio, such a necessity is necessary Without a single table, you can create an app without having to write a single line of code.
In Article 4, I think that the questioner seems to be straying and should not be seen. In the answer, "Generally, it is reflected in the database by passing DataSet with Update method of TableAdapter".
Is there any way to store an existing DataGridView in the database?
Is it without DataSet/DataTable + DataAdapter? Do n’t think about that. It is a waste of time and effort.
DataGridView is a UI, and the most important role is DataSet/DataTable + DataAdapter. It is better to think that it is impossible without it.
Since the contents of the following articles do not need to be read, only look at Figure 1 and Figure 2. You can see at a glance what I said above.
Clarification for DB designers ADO.NET, Part 1
DataGridView is not shown, but it is bound to a DataSet and used by the user to edit the contents of the DataSet.
Try creating a standard app using the Visual Studio wizard.
DB seems to be SQL Server, so the following tutorial
Tutorial: Saving data to a database (single table)
10 lines in a row !! Unconnected data access (ADO.NET) (C #)If you create a typed DataSet + TableAdapter using the Visual Studio data source configuration wizard as shown in
... and make an application using it, the application has the structure shown in the figure on the following page. But you can make it almost without writing your own code.
Connecting to data in a Windows Forms application
If you get used to the operation, you should be able to make it in less than 10 minutes. The problem like this time will not be bothered, and the development man-hours should decrease drastically. Maintenance man-hours should also be reduced. Please try.
- c # - i want to read a txt file with unity and store it in an array
- c # - i want to retrieve the file name of the image displayed in the cell of datagridview
- how to save datagridview as xml file in c #
- c # - paging with windows forms datagridview
- c # - store characters entered on the console in a variable
- i want to store the data on the web in a mysql database
- c # - i want to modify what is used as a database by putting data in objects in unity
- aspnet to store and read database pictures
- Several ways to store pictures in a MySQL database
- c # - i want to process as many records as select
- c # - i want to get a datatable with linq and then outer join
- c # - how to study tablet-based pos system
- c # - display multiple selected items with check boxes of xanarinandroid with displayalert
- c # - i want to know how to write code when using run-time arguments
- c # - i don't understand how to write dependency injection in xamarin/prismunity
- [c #] i want to judge data from multiple devices by serial communication
- c # - dataset is no longer connected to mysql
- created in c #, but combobox etc are not implemented
- c # - i want to convert datetime to int type based on today