private static string DbTypeLengthMySQL(string datatype, string Length) { string str = ""; switch (datatype.Trim().ToLower()) { case "number": str = !(Length == "") ? Length : "4"; goto case "date"; case "varchar2": str = !(Length == "") ? Length : "50"; goto case "date"; case "char": str = !(Length == "") ? Length : "50"; goto case "date"; case "date": case "nchar": case "nvarchar2": case "long": case "long raw": case "bfile": case "blob": return(!(str != "") ? CodeCommon.CSToProcType("MySQL", datatype) : CodeCommon.CSToProcType("MySQL", datatype) + "," + str); default: str = Length; goto case "date"; } }
private static string DbTypeLengthSQLite(string datatype, string Length) { string str = ""; switch (datatype.Trim()) { case "int": case "integer": str = !(Length == "") ? Length : "4"; goto case "image"; case "varchar": str = !(Length == "") ? Length : "50"; goto case "image"; case "char": str = !(Length == "") ? Length : "50"; goto case "image"; case "bit": str = "1"; goto case "image"; case "float": case "numeric": case "decimal": case "money": case "smallmoney": case "binary": case "smallint": case "bigint": case "blob": str = Length; goto case "image"; case "image": case "datetime": case "smalldatetime": case "nchar": case "nvarchar": case "ntext": case "text": case "time": case "date": case "boolean": return(!(str != "") ? CodeCommon.CSToProcType("SQLite", datatype) : CodeCommon.CSToProcType("SQLite", datatype) + "," + str); default: str = Length; goto case "image"; } }
private static string DbTypeLengthSQL(string dbtype, string datatype, string Length) { string str1 = CodeCommon.GetDataTypeLenVal(datatype, Length); string str2; if (str1 != "") { if (str1 == "MAX") { str1 = "-1"; } str2 = CodeCommon.CSToProcType(dbtype, datatype) + "," + str1; } else { str2 = CodeCommon.CSToProcType(dbtype, datatype); } return(str2); }