File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -852,6 +852,33 @@ public SQLiteCommand CreateCommand (string cmdText, params object[] ps)
852852 return cmd ;
853853 }
854854
855+ /// <summary>
856+ /// Creates a new SQLiteCommand given the command text with arguments. Place a "[@:]VVV"
857+ /// in the command text for each of the arguments.
858+ /// </summary>
859+ /// <param name="cmdText">
860+ /// The fully escaped SQL.
861+ /// </param>
862+ /// <param name="args">
863+ /// Arguments to substitute for the occurences of "[@:]VVV" in the command text.
864+ /// </param>
865+ /// <returns>
866+ /// A <see cref="SQLiteCommand" />
867+ /// </returns>
868+ public SQLiteCommand CreateCommand ( string cmdText , Dictionary < string , object > args )
869+ {
870+ if ( ! this . _open )
871+ throw SQLiteException . New ( SQLite3 . Result . Error , "Cannot create commands from unopened database" ) ;
872+
873+ SQLiteCommand cmd = NewCommand ( ) ;
874+ cmd . CommandText = cmdText ;
875+ foreach ( var kv in args )
876+ {
877+ cmd . Bind ( kv . Key , kv . Value ) ;
878+ }
879+ return cmd ;
880+ }
881+
855882 /// <summary>
856883 /// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?'
857884 /// in the command text for each of the arguments and then executes that command.
You can’t perform that action at this time.
0 commit comments