string qry = "select * from PurchaseProduct where 0 = 1";
sa = new SqlDataAdapter(qry, conn);
dataSet = new DataSet();
sa.Fill(dataSet);
dataSet.Tables[0].Columns.Add("dtcolnPurchaseProductProductName",typeof(string));
Insert DataTable rows to DataBaseTables using DataAdapter: leave out one column in DataTable
-
02-06-2022 - |
سؤال
i have DataTable named dtPurchaseProduct that has columns
- dtcolPurchaseProduct_No
- dtcolnInvoiceNo
- dtcolnProductNo
- dtcolnProductName
- dtcolnQuantity
- dtcolnPrice
these are bound to datagridview except dtcolnProductNo because only product names are required to be seen
and i have DatabaseTable Named PurchaseProduct that has columns
- PurchaseProduct_No
- InvoiceNo
- ProductNo
- Quantity
- Price
now after allowing user to add/update/delete the DataTable rows through textboxes i want to insert these rows to DataBaseTable with DataAdapter
Is it possible to do that? i don't have select command and even the columns are not exactly the same that is i don't have database column for dtlcolnProductName
المحلول
لا تنتمي إلى StackOverflow