DeleteCommand
是一個用於指定從資料庫刪除資料的 SQL 命令,通常與 SqlDataAdapter
搭配使用。
DELETE FROM [Products]
WHERE (([ProductID] = @Original_ProductID) AND ([ProductName] = @Original_ProductName) AND ([Discontinued] = @Original_Discontinued))
InsertCommand
是一個用於指定將新資料插入資料庫的 SQL 命令,通常與 SqlDataAdapter
搭配使用。
INSERT INTO [Products] ([ProductName],
[Discontinued]) VALUES (@ProductName, @Discontinued); SELECT ProductID, ProductName, Discontinued FROM Products
WHERE (ProductID = SCOPE_IDENTITY())
SelectCommand
是一個用於指定從資料庫查詢資料的 SQL 命令,通常與 SqlDataAdapter
搭配使用。
SELECT ProductID, ProductName, Discontinued FROM Products
UpdateCommand
是一個用於指定更新資料庫中現有資料的 SQL 命令,通常與 SqlDataAdapter
搭配使用。
UPDATE [Products] SET [ProductName] = @ProductName, [Discontinued] = @Discontinued WHERE (([ProductID] = @Original_ProductID) AND ([ProductName] = @Original_ProductName) AND ([Discontinued] = @Original_Discontinued)); SELECT ProductID, ProductName, Discontinued FROM Products WHERE (ProductID = @ProductID)
connectionString
是用來定義資料庫連線資訊的字串,包括伺服器、資料庫、驗證方式等。/tog
Windows Forms 的查詢產生器精靈是一個可視化工具,幫助你建立 SQL 查詢,無需手動編寫 SQL 語句。