zoukankan      html  css  js  c++  java
  • 数据类型和C#关系对应

    sqlserver与c#中数据类型的对应关系
    ///
    private string changetocsharptype(string type)
    {
    string reval=string.empty;
    switch(type.tolower())
    {
    case "int ":
    reval= "int32 ";
    break;
    case "text ":
    reval= "string ";
    break;
    case "bigint ":
    reval= "int64 ";
    break;
    case "binary ":
    reval= "system.byte[] ";
    break;
    case "bit ":
    reval= "boolean ";
    break;
    case "char ":
    reval= "string ";
    break;
    case "datetime ":
    reval= "system.datetime ";
    break;
    case "decimal ":
    reval= "system.decimal ";
    break;
    case "float ":
    reval= "system.double ";
    break;
    case "image ":
    reval= "system.byte[] ";
    break;
    case "money ":
    reval= "system.decimal ";
    break;
    case "nchar ":
    reval= "string ";
    break;
    case "ntext ":
    reval= "string ";
    break;
    case "numeric ":
    reval= "system.decimal ";
    break;
    case "nvarchar ":
    reval= "string ";
    break;
    case "real ":
    reval= "system.single ";
    break;
    case "smalldatetime ":
    reval= "system.datetime ";
    break;
    case "smallint ":
    reval= "int16 ";
    break;
    case "smallmoney ":
    reval= "system.decimal ";
    break;
    case "timestamp ":
    reval= "system.datetime ";
    break;
    case "tinyint ":
    reval= "system.byte ";
    break;
    case "uniqueidentifier ":
    reval= "system.guid ";
    break;
    case "varbinary ":
    reval= "system.byte[] ";
    break;
    case "varchar ":
    reval= "string ";
    break;
    case "variant ":
    reval= "object ";
    break;
    default:
    reval= "string ";
    break;
    }
    return reval;
    }

  • 相关阅读:
    4.变量与运算符
    2.python的基本数据类型
    bzoj 2337: [HNOI2011]XOR和路径
    bzoj 2109: [Noi2010]Plane 航空管制
    bzoj 1566: [NOI2009]管道取珠
    bzoj 3439: Kpm的MC密码
    bzoj 2957: 楼房重建
    十、mysql之索引原理与慢查询优化
    九、MySQL 5.7.9版本sql_mode=only_full_group_by问题
    八、多表查询
  • 原文地址:https://www.cnblogs.com/topguntopgun/p/11815455.html
Copyright © 2011-2022 走看看