Unable to Delete data from data grid view
I encountered a problem where when the user select the id from the data grid view and click the 'delete' button, A error prompts us like this: "Input string was not in the correct format".

Here are the codes to make you guys have better understanding of the codes.

    private void btnDel_Click(object sender, EventArgs e)
        {
            using (satsEntities Setupctx = new satsEntities())
            {
                int ID = Int32.Parse(lblID.Text);
                var DeleteSL = (from delLS in Setupctx.locationstations
                               where delLS.locationstationID == ID
                               select delLS).Single();
                Setupctx.DeleteObject(DeleteSL);
                Setupctx.SaveChanges();
                this.Delete_LS_Load(null, EventArgs.Empty);
                MessageBox.Show("Selected Location Station Has Been Deleted.");
            }
        }
Unable to Delete data from data grid view
===

I encountered a problem where when the user select the id from the data grid view and click the 'delete' button, A error prompts us like this: "Input string was not in the correct format".

Here are the codes to make you guys have better understanding of the codes.

    private void btnDel_Click(object sender, EventArgs e)
        {
            using (satsEntities Setupctx = new satsEntities())
            {
                int ID = Int32.Parse(lblID.Text);
                var DeleteSL = (from delLS in Setupctx.locationstations
                               where delLS.locationstationID == ID
                               select delLS).Single();
                Setupctx.DeleteObject(DeleteSL);
                Setupctx.SaveChanges();
                this.Delete_LS_Load(null, EventArgs.Empty);
                MessageBox.Show("Selected Location Station Has Been Deleted.");
            }
        }