c# - How to edit all selected rows of ultragrid -


I have used an ultragrid in my windows application to show the records of the table of my database, datatus property dataset To set which is from that table.

The number of rows can be approximately 100000 rows.

Now I have 2 questions:

1) I want to let the user choose multiple rows of this grid and then want to edit them all. To do this, I need to know which cells have the same values ​​in these selected rows and who are not, and then show the same column in one form.

I first thought that the first solution was checking all the columns of all selected rows through 2 foreach loops. Is there any better solution for this ??

2) Finally, when the user saves the press button, updates should be applied to the table. What is the best way to do this ??? (Use the IN command or the sqldataadapter's updatecommand or ...)

1) You can grouping in the ultragrid, on which you can see all the columns and save the data. Will appear together after the same group of columns and it will save a lot of time in data analysis and find out which column data will be identical in different rows. Once you get a list of similar data, you can easily operate them for each loop or loop, because you will be able to reach the count of rows that arise in this way. 2) System.Data.SqlClient.SqlBulkCopy here is the documentation for this, and of course there are plenty of online tutorials.
Should anyone refrain from IN when they do not. The record is high because it affects the performance. If you do not want to use Sqlblakcopy, you can also go for the ultrgrid update data (a very useful feature of ultragrid)

Comments