Question Update OrderStatus in Database Table of ony selected Orders in DataGridView using VB

CX Mike

New member
Joined
Nov 13, 2011
Messages
2
Programming Experience
Beginner
I am developing a Windows Forms Based Application using dbo.database and Visual Basic:

I populate some Orders in DataGridView1 using LINQ 2 SQL from "tbl_Orders" where OrderStatus is "Pending". I change OrderStatus Column Type to "CheckBoxColumn" in DataGridView1, Now I want that when I select some records (Orders) by checking respective checkboxes and click on "btn_UpdateStatus" Button, program pick OrderID's of only selected orders and update OrderStatus of Only selected Records (Orders) from "Pending" to "Completed" in Database Table "tbl_Orders" and DataGridView1 should be Refreshed.

I am using VB, Kindly help me with complete solution?
 
You presumably have a list of L2S objects bound to the grid. You can call the Where extension method on that list to get a new list that only contains those objects that satisfy a particular condition, e.g.
Dim pendingItems = items.Where(Function(item) item.Pending).ToArray()
That will get all the items where Pending is True and put them into a new array.
 
Thanks buddy,

Kindly share if you have any example because I am new to programming and it is my very first application.
 
Back
Top