0
:C# benim DataGridView sütun göstermek MySQL veritabanı kullanarak yanlış yıl
Benim DataGridView
sonuçları:
Kodum
MySqlCommand cmd = new MySqlCommand("SELECT Invoices.InvoiceDate,InvoiceDetail.ProductName,InvoiceDetail.Quantity,InvoiceDetail.Discount FROM Invoices INNER JOIN InvoiceDetail ON Invoices.InvoiceID=InvoiceDetail.InvoiceID WHERE Invoices.CustomersID='" + textBox1.Text + "'", con);
MySqlDataAdapter sda = new MySqlDataAdapter();
sda.SelectCommand = cmd;
DataTable dt = new DataTable();
sda.Fill(dt);
BindingSource bs = new BindingSource();
bs.DataSource = dt;
dataGridView1.DataSource = bs;
dataGridView1.Columns[0].DefaultCellStyle.Format = "yyyy/MM/dd";
sda.Update(dt);
Biçimlendirmediğinizde ne olur? Yorumlamayı deneyin: dataGridView1.Columns [0] .DefaultCellStyle.Format = "yyyy/MM/dd"; bu satır? – FaizanRabbani