No mapping exists from object type System.Windows.Forms.DataGridViewRow to a known managed provider native type.
Using conn As New SqlConnection(My.Settings.Smitty)
Using cmd As New SqlCommand()
With cmd
.Connection = conn
.CommandText = "Update Repairs set status = @status WHERE RepairNumber = @repairNumber"
.Parameters.AddWithValue("@status", "Awaiting Part Installation")
.Parameters.AddWithValue("@repairNumber", RepairInventoryDataGridView.Rows(4))
End With
conn.Open()
cmd.ExecuteNonQuery()
End Using
End Using
MessageBox.Show("Inventory Successfully Updated")
I have a datagridview that shows items I ordered. I want to check the items into inventory and change the status to "Awaiting part installation" for repairs that the part has arrived. I am hoping to do this through the datagrid and it updates from a particular row. I use the above code and get a Mapping error. I have tried several different ways and keep getting errors. I appreciate any help I can get.