mysql Sql参数用?而不用@

mysql Sql参数用?而不用@

 

 StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into COS_Order(");
            strSql.Append("Ord_DiscountInformation,Ord_Suppliers)");
            strSql.Append(" values (");
            strSql.Append("?Ord_DiscountInformation,?Ord_Suppliers)");
            MySqlParameter[] parameters = {
     new MySqlParameter("?Ord_DiscountInformation", MySqlDbType.VarChar,255),
     new MySqlParameter("?Ord_Suppliers", MySqlDbType.VarChar,255),
            parameters[0].Value = model.Ord_DiscountInformation;
            parameters[1].Value = model.Ord_Suppliers;

你可能感兴趣的:(sql,mysql,insert,Parameters)