private void OpenSuspedForm() { pnl_suspend_data_list_wlc_data.Controls.Clear(); suspend_data_list f = new suspend_data_list(this); f.TopLevel = false; pnl_suspend_data_list_wlc_data.Controls.Add(f); TextInsert(); f.Show(); }
public void InsertTopSuspend() { try { suspend_data_list f = new suspend_data_list(this); //int index = dataGridView_wlc_data.Rows[0].Index; int index = dataGridView_wlc_data.SelectedRows[0].Index; DataRow dr = dt.NewRow(); string Query = @"SELECT * FROM wlc_data WHERE pid = '" + GetText.lb_pid + "'"; conn = new SQLiteConnection(); conn.ConnectionString = Helpers.connectionString; SQLiteCommand cmd = new SQLiteCommand(Query, conn); conn.Open(); cmd.ExecuteNonQuery(); drt = cmd.ExecuteReader(); while (drt.Read()) { string _1pid = (string)(drt["pid"]); string _pid = _1pid.Substring(2, 8); dr[0] = "F1" + _pid; dr[1] = (drt["vin"]); dr[2] = (drt["plan_date"]); dr[3] = (drt["wlc_code"]); dr[4] = (drt["model_code"]); dr[5] = (drt["suffix"]); dr[6] = (drt["chassis_number"]); dr[7] = "Plan"; dt.Rows.InsertAt(dr, index); } conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }