textBox4.Text = parts[1] Exception -> S BOX Reality -> S
while (reader.Read()) { chart1.Series[0].Points.AddXY(reader.GetString("ORDER_NUMBER"), reader.GetDateTime("TOTAL_TIME")); }
private void dataGridView4_UserAddedRow(object sender, DataGridViewRowEventArgs e) { string name_project= e.Row.Cells[1].Value.ToString(); int id = (int)Convert.ToInt64(e.Row.Cells[0].Value.ToString()); MySqlConnection connection = new MySqlConnection("datasource = localhost; port = 3306; username = root; password = "); MySqlCommand cmd = new MySqlCommand("INSERT INTO projekt1.projects(PROJECT_NAME) VALUES(@NPROJECT_NAME);", connection); cmd.Parameters.Add("@ID", MySqlDbType.Int64).Value = id; cmd.Parameters.Add("@PROJECT_NAME", MySqlDbType.VarChar).Value = name_project; try { connection.Open(); cmd.ExecuteNonQuery(); connection.Close(); MessageBox.Show("ok"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
System.NullReferenceException: The object reference has not been set to the instance of the object. System.Windows.Forms.DataGridViewCell.Value.get returned null.”