0
我有我的SQL數據庫中的四個表C#SQL是否有可能從一個連接表插入到datagridview的
在C#中我做了一個DataGridView這說明DeliveryDate,數量,描述和價格從Order,Linkedtable和Stock表中加入一個select語句。
這裏是用來連接三個表到一個datagridview的
// this code for the load button of the datagridview
con.Open();
SqlDataAdapter sda = new SqlDataAdapter("SELECT O.DeliveryDate, L.Quantity, S.Description, S.Price FROM [Order] O JOIN Linkedtable L ON O.OrderID = L.OrderID JOIN Stock S ON S.StockID = L.StockID ORDER BY O.DeliveryDate ", con);
DataTable DATA = new DataTable();
sda.Fill(DATA);
dataGridView1.DataSource = DATA;
con.Close();
我想插入DeliveryDate,數量,描述和價格從四個文本框到datagridview,但我不知道如何做一個INSERT語句加入像我有SELECT語句的表,有沒有辦法做到這一點?