Member Avatar for spot_1

cant upload code

Member Avatar for spot_1


On the top of your new post you see some buttons. Click on the code button, paste your code in the window that opens.

Member Avatar for spot_1
DataTable dtabl = new DataTable();
        DataSet ds = new DataSet();
        DataSet dS = new DataSet();
        private void Form1_Load(object sender, EventArgs e)

            string[] zones =ConfigurationManager.AppSettings["TimeZones"].Split(',');
            Timecombo.DataSource = zones;
            dataGridView1.DataSource = dS.Tables[2];
            Departcombo.SelectedIndex = 0;
            DataGridViewButtonColumn btn = new DataGridViewButtonColumn();
            btn.Text = "Save";
            btn.UseColumnTextForButtonValue = true;
            DataGridViewButtonColumn priority = new DataGridViewButtonColumn();
            priority.Text = "ALL Priority to 1";
            priority.UseColumnTextForButtonValue = true;
            DataGridViewButtonColumn createparts = new DataGridViewButtonColumn();
            createparts.Text = "Create Parts";

            createparts.UseColumnTextForButtonValue = true;

            label3.Visible = false;
            label5.Visible = false;
            label7.Visible = false;
            btnsave.Visible = false;
            btnClose.Visible = false;


        private DataTable GetDataTableFromDGV(DataGridView dataGridView1)
             var dt = new DataTable();
            foreach (DataGridViewColumn column in dataGridView1.Columns)
                 if (column.Visible)

             object[] cellValues = new object[dataGridView1.Columns.Count];
             foreach (DataGridViewRow row in dataGridView1.Rows) 
                    for (int i = 0; i < 9; i++) 
                            cellValues[i] = row.Cells[i].Value;

                    return dt;

Line 2 ds, line3 dS. This is calling for disaster. Give meaningful name to ALL your variables. I could never infer in my life what ds or dS are standing for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.