string sql = " select a.2, a.3, b.2, b.3 from a, b, c where a.1= c.1 and b.1 = c.1 "; //查詢語句太長 我就直接把意思表達出來 沒有粘代碼
DataSet ds1 = new DataSet();
DataTable dt = new DataTable ();
DataSet ds2 = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
da.Fill(ds1);
dt = ds1.Tables[0].Copy();
ds2.Tables.Add(dt);
dataGridView1.DataSource = ds2.Tables[0];
你什麼問題?dataGridView1顯示不了數據嗎,dataGridView1設置了列的字段對應了嗎