I have a DataGrid view control in which i am binding List<T> control and Gridview control has many rows. user modified 2 rows only, i need only that two rows to send to database SqlServer.
if you are binding to a list control and each list item contains an object. then you can add a property in object like isModified and you can set it to true. when you want to update those changes to database then iterate list elements and send only those objects those isModified property is set to true.
OR
you can maintain a list of indexes in memory like Arraylist , when ever a row is modified add the index of that row in ArrayList . after that send only those objects to Database whose indexes are in ArrayList
like in ArrayList you have 5,8,20 then you can send them easily with index
if you are binding to a list control and each list item contains an object. then you can add a property in object like isModified and you can set it to true. when you want to update those changes to database then iterate list elements and send only those objects those isModified property is set to true.
OR
you can maintain a list of indexes in memory like Arraylist , when ever a row is modified add the index of that row in ArrayList . after that send only those objects to Database whose indexes are in ArrayList
like in ArrayList you have 5,8,20 then you can send them easily with index