且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在表中插入多个值?使用c#

更新时间:2022-04-02 08:39:57

查找交易:允许多个查询要作为块执行。如果其中一个查询失败,您可以执行回滚以进入数据库的先前状态。

顺便提一下,建议使用参数化查询:它们有助于防止SQL注入攻击,它们有助于处理奇数数据类型(例如日期时间值或带引号的字符串)。
Look for Transaction: that allows for several queries to be executed as a block. If one of the queries fails, you can do a Rollback to get to the previous state of your database.
By the way, it is advisable to use parameterized queries: they help prevent SQL injection attacks, and they help dealing with odd datatypes (e.g. datetime values or strings with quotation marks).

>