private void Export_GetConditionString(MySqlDataReader rdr, MySqlTable table, StringBuilder sb) { bool isFirst = true; for (int i = 0; i < rdr.FieldCount; i++) { string colName = rdr.GetName(i); var col = table.Columns[colName]; if (col.IsPrimaryKey) { if (isFirst) { isFirst = false; } else { sb.Append(" and "); } sb.Append("`"); sb.Append(colName); sb.Append("`="); sb.Append(QueryExpress.ConvertToSqlFormat(rdr, i, true, true, col)); } } }
private string Export_GetValueString(MySqlDataReader rdr, MySqlTable table) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < rdr.FieldCount; i++) { string columnName = rdr.GetName(i); if (table.Columns[columnName].IsGeneratedColumn) { continue; } if (sb.Length == 0) { sb.AppendFormat("("); } else { sb.AppendFormat(","); } object ob = rdr[i]; var col = table.Columns[columnName]; sb.Append(QueryExpress.ConvertToSqlFormat(rdr, i, true, true, col)); } sb.AppendFormat(")"); return(sb.ToString()); }