zoukankan      html  css  js  c++  java
  • SQL Serve和C# 数据类型之间的转换

     public string ChangeDBTypeToCSharpType(string type)
          {
           string reval=string.Empty;
           switch(type.ToLower())
           {
            case "int":
             reval= "int";
             break;
            case "text":
             reval= "string";
             break;
            case "bigint":
             reval= "long";
             break;
            case "binary":
             reval= "object";
             break;
            case "bit":
             reval= "bool";
             break;
            case "char":
             reval= "string";
             break;
            case "datetime":
             reval= "DateTime";
             break;
            case "decimal":
             reval= "decimal";
             break;
            case "float":
             reval= "double";
             break;
            case "image":
             reval= "byte[]";
             break;
            case "money":
             reval= "decimal";
             break;
            case "nchar":
             reval= "string";
             break;
            case "ntext":
             reval= "string";
             break;
            case "numeric":
             reval= "decimal";
             break;
            case "nvarchar":
             reval= "string";
             break;
            case "real":
             reval= "float";
             break;
            case "smalldatetime":
             reval= "DateTime";
             break;
            case "smallint":
             reval= "short";
             break;
            case "smallmoney":
             reval= "decimal";
             break;
            case "timestamp":
             reval= "System.DateTime";
             break;
            case "tinyint":
             reval= "byte[]";
             break;
            case "uniqueidentifier":
             reval= "Guid";
             break;
            case "varbinary":
             reval= "byte[]";
             break;
            case "varchar":
             reval= "string";
             break;
            case "Variant":
             reval="object";
             break;
            default:
             reval= "string";
             break;
           }
           return reval;
          }
  • 相关阅读:
    Windows RC版、RTM版、OEM版、RTL版、VOL版的区别
    jQuery MiniUI开发系列之:创建组件对象
    Mobile Web 调试指南(2):远程调试
    Using the viewport meta tag to control layout on mobile browsers
    鼠标滚轮事件MouseWheel
    photoshop基础
    10个jQuery插件分享
    Centos 安装nodejs
    Centos 安装.NET CORE 3.1
    Centos 安装nginx
  • 原文地址:https://www.cnblogs.com/zhangqs008/p/2341213.html
Copyright © 2011-2022 走看看