public string ToMysqlString(string cellgs) { StringBuilder sbuilder = new StringBuilder(); if (Cellgs.Equals("ALL") || cellgs.Equals("ALL") || Cellgs.Equals(cellgs)) { sbuilder.Append(" `" + CellName + "` "); switch (CellValueType.ToLower()) { case "int": sbuilder.Append("int "); break; case "boolean": sbuilder.Append(" TINYINT(1) "); break; case "double": sbuilder.Append(" double "); break; case "float": sbuilder.Append(" float "); break; case "string": if (CellLength < 500) { sbuilder.Append(" VARCHAR(" + CellLength + ") "); } else if (CellLength < 10000) { sbuilder.Append(" TEXT "); } else { sbuilder.Append(" LONGTEXT "); } break; case "long": sbuilder.Append(" bigint "); break; } if (IsPKey) { sbuilder.Append(" NOT NULL primary key "); } sbuilder.Append(" COMMENT '" + CellNotes + "'"); } return(sbuilder.ToString()); }
public string ToXmlString(string cellgs, bool is_Not_Null) { if (Cellgs.Equals("ALL") || cellgs.Equals("ALL") || Cellgs.Equals(cellgs)) { if (is_Not_Null) { if (string.IsNullOrWhiteSpace(CellValue) || "0".Equals(CellValue)) { return(null); } } return(" " + CellName + "=\"" + CellValue + "\""); } return(""); }