private void SelectPartFrm_Load(object sender, EventArgs e) { try { var db = new linqDataContext(); GVTableShowPforD.DataSource = db.ShowPartsforDevice(); this.FormBorderStyle = FormBorderStyle.FixedDialog; } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }