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 @@ -871,6 +871,33 @@ public SQLiteCommand CreateCommand (string cmdText, params object[] ps)
871
871
return cmd ;
872
872
}
873
873
874
+ /// <summary>
875
+ /// Creates a new SQLiteCommand given the command text with arguments. Place a "[@:]VVV"
876
+ /// in the command text for each of the arguments.
877
+ /// </summary>
878
+ /// <param name="cmdText">
879
+ /// The fully escaped SQL.
880
+ /// </param>
881
+ /// <param name="args">
882
+ /// Arguments to substitute for the occurences of "[@:]VVV" in the command text.
883
+ /// </param>
884
+ /// <returns>
885
+ /// A <see cref="SQLiteCommand" />
886
+ /// </returns>
887
+ public SQLiteCommand CreateCommand ( string cmdText , Dictionary < string , object > args )
888
+ {
889
+ if ( ! this . _open )
890
+ throw SQLiteException . New ( SQLite3 . Result . Error , "Cannot create commands from unopened database" ) ;
891
+
892
+ SQLiteCommand cmd = NewCommand ( ) ;
893
+ cmd . CommandText = cmdText ;
894
+ foreach ( var kv in args )
895
+ {
896
+ cmd . Bind ( kv . Key , kv . Value ) ;
897
+ }
898
+ return cmd ;
899
+ }
900
+
874
901
/// <summary>
875
902
/// Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?'
876
903
/// 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