String strsql = "insert into test_table"
+ "(Zdsxh, zdsbm, MC, fzrbh, bxrbh, bxrq, sjfrom, sjto) values"
+ "(@ Zdsxh, @ zdsbm, @ MC, @ fzrbh, @ bxrbh, @ bxrq, @ sjfrom, @ sjto )";
Replace strsql
String strsql = "insert into test_table"
+ "(Zdsxh, zdsbm, MC, fzrbh, bxrbh, bxrq, sjfrom, sjto) values"
+ "(?,?,?,?,?,?,?,?) ";
Replacement placeholder
Use a regular expression:
Strsql = RegEx. Replace (strsql, @ "@ [^,] *,", "?, ", Regexoptions. ignorecase );
Add
Using system. Text. regularexpressions;
Replacement placeholder
String strsql = "insert into test_table"
+ "(Zdsxh, zdsbm, MC, fzrbh, bxrbh, bxrq, sjfrom, sjto) values"
+ "(@ Zdsxh, @ zdsbm, @ MC, @ fzrbh, @ bxrbh, @ bxrq, @ sjfrom, @ sjto )";
Strsql = RegEx. Replace (strsql, "@ \ W + ","? "); String strsql =" insert into test_table"
+ "(Zdsxh, zdsbm, MC, fzrbh, bxrbh, bxrq, sjfrom, sjto) values"
+ "(@ Zdsxh, @ zdsbm, @ MC, @ fzrbh, @ bxrbh, @ bxrq, @ sjfrom, @ sjto )";
Replace strsql
String strsql = "insert into test_table"
+ "(Zdsxh, zdsbm, MC, fzrbh, bxrbh, bxrq, sjfrom, sjto) values"
+ "(?,?,?,?,?,?,?,?) ";
Replacement placeholder
Use a regular expression:
Strsql = RegEx. Replace (strsql, @ "@ [^,] *,", "?, ", Regexoptions. ignorecase );
Add
Using system. Text. regularexpressions;
Replacement placeholder
String strsql = "insert into test_table"
+ "(Zdsxh, zdsbm, MC, fzrbh, bxrbh, bxrq, sjfrom, sjto) values"
+ "(@ Zdsxh, @ zdsbm, @ MC, @ fzrbh, @ bxrbh, @ bxrq, @ sjfrom, @ sjto )";
Strsql = RegEx. Replace (strsql, "@ \ W + ","? ");