Datagrid using VB.NET (web vs. windows)
-
I am writing a WINDOWS form with a datagrid where i need to run a loop and basically flag every item (containers to be shipped in this case). Now, I've done this with a webform and have had no problems what so ever with it but when it comes to a Windows Form the controls are differnt i.e., namespaces I can't perform the same functions. Here is the sample code from a web form and I was wondering if anyone had any idea how to approach this from a windows form? Any help would be greatly appreciated. Thanks! 'Insert Shipping Request Information into tblContainer - manifestDocument & shipingRequestID Dim myDataGridItem As DataGridItem Dim strContainerID As String lblStatus.Text = "
You selected the Following containers to be shipped:" 'Look at notes: Put the update clause back in at lblStatus.Text to update those records as they cycle through the Loop For Each myDataGridItem In dgContainer.Items strContainerID = CType(myDataGridItem.FindControl("lblContainerID"), Label).Text With cmdUpdateContainer .Parameters("@containerID").Value = strContainerID .Parameters("@containerShippingRequest").Value = fldID.Text .Parameters("@containerUpdateDate").Value = Today .Parameters("@containerDateShip").Value = fldDate.Text .Parameters("@storageType").Value = "PEN" .Parameters("@wasteStream").Value = ddlWasteStream.SelectedItem.Text End With SqlConnection2.Open() cmdUpdateContainer.ExecuteNonQuery() SqlConnection2.Close() End If Next:confused: