-1
我無法弄清楚如何獲取一個SQL值來顯示它。我做了搜索,然後想在DR2中顯示它[3]我如何從SQL獲取唯一值
foreach (DataRow dr in dt.Rows)
{
{
//Buscar ventas de esa semana
con.SqlQuery("Select PPstadmax from PPminmax where ppwochennr = '" + textBox1.Text + "' and PPartikelnr ='" + dr[0] + "'");
DataTable dt2 = new DataTable();
dt2.Columns.Add("art", typeof(int));
dt2.Columns.Add("Beschreibung", typeof(string));
dt2.Columns.Add("Flasche", typeof(string));
dt2.Columns.Add("Hist.Verkauft", typeof(int));
dt2.Columns.Add("Bestand", typeof(int));
dt2.Columns.Add("Produktion", typeof(int));
dt2.Columns.Add("Nächste Prod", typeof(int));
DataRow dr2 = dt2.NewRow();
dr2[0] = dr[0];
dr2[1] = dr[1];
dr2[2] = dr[3];
here >>>> dr2[3] = I want the value i found here
dr[4] = 0;
dr[5] = 0;
dr[6] = 0;
dataGridView1.DataSource = dt2;
}
}