首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 数据库类的扩展:NET数据类型与数据库字段类型 [已结贴,结贴人:lzmtw]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:25:06 楼主
    对于一个DataTable,它的定义和数据可能来自于xml文件,那么,如已有DbConnection连接,能否据此DataTable在数据库中创建新的表,并同时将数据更新到表中去?
    答案是可行,但不保证准确。不保证准确,意思是,已创建的新表的某些字段,其数据类型并非如己所愿。其中的原因是:NET数据类型与数据库的字段类型存在一对多的关系,而不是一对一的关系。

    这个贴子看看数据库字段类型与NET数据类型的对应关系。

    请使用IE7浏览本贴
    20  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:38:041楼 得分:0
    获取数据库字段类型信息,可以通过以下代码实现

    VB.NET code
    Dim cn As DbConnection 'cn = New 创建具体的数据库连接 cn.Open() Dim table As DataTable = cn.GetSchema(DbMetaDataCollectionNames.DataTypes) cn.Close()


    不同的连接方式,获取同一数据库的类型信息,反映并不一样。
    一般来说,OleDB比较笼统,ODBC比较准确,而针对性更强的连接,如SqlClient,那是精确了。

    下面给出不同数据库,不同连接方式的字段类型信息。
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:43:482楼 得分:0
    SqlServer,SqlClient

    XML code
    ┌──┬────────────────┬──────────────┬──────────┬────────────────────┬──────────────────────────────────────────┬──────────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│ CreateFormat │ CreateParameters │ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 1│bigint │ 0│ 19│bigint │ │System.Int64 │ True │ True │ False │ True │ True │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 2│binary │ 1│ 8000│binary({0}) │length │System.Byte[] │ False │ True │ False │ True │ False │ False│ True │ True │ False │ │ │ │ False │ │0x │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 3│bit │ 2│ 1│bit │ │System.Boolean │ False │ False │ False │ True │ False │ False│ True │ True │ False │ │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 4│char │ 3│2147483647│char({0}) │length │System.String │ False │ True │ False │ True │ False │ False│ True │ True │ True │ │ │ │ False │ │' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 5│datetime │ 4│ 23│datetime │ │System.DateTime │ False │ True │ False │ True │ False │ False│ True │ True │ True │ │ │ │ False │ │{ts ' │'} │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 6│decimal │ 5│ 38│decimal({0}, {1}) │precision,scale │System.Decimal │ True │ True │ False │ True │ False │ False│ True │ True │ False │ False │ 38│ 0│ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 7│numeric │ 5│ 38│numeric({0}, {1}) │precision,scale │System.Decimal │ True │ True │ False │ True │ False │ False│ True │ True │ False │ False │ 38│ 0│ False │ │ │ │ └──┴────────────────┴──────────────┴──────────┴────────────────────┴──────────────────────────────────────────┴──────────────────────┴────────────────────┴────────────┴────────────────┴──────────────┴──────────────────────┴──────┴──────────┴────────────┴────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴──────────────┴──────────────┘
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:45:123楼 得分:0
    XML code
    ┌──┬────────────────┬──────────────┬──────────┬────────────────────┬──────────────────────────────────────────┬──────────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│ CreateFormat │ CreateParameters │ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 8│float │ 6│ 53│float({0}) │number of bits used to store the mantissa │System.Double │ False │ True │ False │ True │ False │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │ 9│image │ 7│2147483647│image │ │System.Byte[] │ False │ True │ False │ False │ False │ True │ True │ False │ False │ │ │ │ False │ │0x │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │10│int │ 8│ 10│int │ │System.Int32 │ True │ True │ False │ True │ True │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │11│money │ 9│ 19│money │ │System.Decimal │ False │ False │ False │ True │ True │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │12│nchar │ 10│1073741823│nchar({0}) │length │System.String │ False │ True │ False │ True │ False │ False│ True │ True │ True │ │ │ │ False │ │N' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │13│ntext │ 11│1073741823│ntext │ │System.String │ False │ True │ False │ False │ False │ True │ True │ False │ True │ │ │ │ False │ │N' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │14│nvarchar │ 12│1073741823│nvarchar({0}) │max length │System.String │ False │ True │ False │ False │ False │ False│ True │ True │ True │ │ │ │ False │ │N' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │15│real │ 13│ 7│real │ │System.Single │ False │ True │ False │ True │ False │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ └──┴────────────────┴──────────────┴──────────┴────────────────────┴──────────────────────────────────────────┴──────────────────────┴────────────────────┴────────────┴────────────────┴──────────────┴──────────────────────┴──────┴──────────┴────────────┴────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴──────────────┴──────────────┘
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:46:404楼 得分:0
    XML code
    ┌──┬────────────────┬──────────────┬──────────┬────────────────────┬──────────────────────────────────────────┬──────────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│ CreateFormat │ CreateParameters │ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │16│uniqueidentifier│ 14│ 16│uniqueidentifier │ │System.Guid │ False │ True │ False │ True │ False │ False│ True │ True │ False │ │ │ │ False │ │' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │17│smalldatetime │ 15│ 16│smalldatetime │ │System.DateTime │ False │ True │ False │ True │ False │ False│ True │ True │ True │ │ │ │ False │ │{ts ' │'} │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │18│smallint │ 16│ 5│smallint │ │System.Int16 │ True │ True │ False │ True │ True │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │19│smallmoney │ 17│ 10│smallmoney │ │System.Decimal │ False │ False │ False │ True │ True │ False│ True │ True │ False │ False │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │20│text │ 18│2147483647│text │ │System.String │ False │ True │ False │ False │ False │ True │ True │ False │ True │ │ │ │ False │ │' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │21│timestamp │ 19│ 8│timestamp │ │System.Byte[] │ False │ False │ False │ True │ False │ False│ False │ True │ False │ │ │ │ True │ │0x │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │22│tinyint │ 20│ 3│tinyint │ │System.SByte │ True │ True │ False │ True │ True │ False│ True │ True │ False │ True │ │ │ False │ │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │23│varbinary │ 21│1073741823│varbinary({0}) │max length │System.Byte[] │ False │ True │ False │ False │ False │ False│ True │ True │ False │ │ │ │ False │ │0x │ │ └──┴────────────────┴──────────────┴──────────┴────────────────────┴──────────────────────────────────────────┴──────────────────────┴────────────────────┴────────────┴────────────────┴──────────────┴──────────────────────┴──────┴──────────┴────────────┴────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴──────────────┴──────────────┘
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:47:195楼 得分:0
    XML code
    ┌──┬────────────────┬──────────────┬──────────┬────────────────────┬──────────────────────────────────────────┬──────────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│ CreateFormat │ CreateParameters │ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │24│varchar │ 22│2147483647│varchar({0}) │max length │System.String │ False │ True │ False │ False │ False │ False│ True │ True │ True │ │ │ │ False │ │' │' │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │25│sql_variant │ 23│ │sql_variant │ │System.Object │ False │ True │ False │ False │ False │ False│ True │ True │ False │ │ │ │ False │ False │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │26│xml │ 25│2147483647│xml │ │System.String │ False │ False │ False │ False │ False │ True │ True │ False │ False │ │ │ │ False │ False │ │ │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │27│date │ 31│ 3│date │ │System.DateTime │ False │ False │ False │ True │ True │ False│ True │ True │ True │ │ │ │ False │ │{ts ' │'} │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │28│time │ 32│ 5│time({0}) │scale │System.TimeSpan │ False │ False │ False │ False │ False │ False│ True │ True │ True │ │ 7│ 0│ False │ │{ts ' │'} │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │29│datetime2 │ 33│ 8│datetime2({0}) │scale │System.DateTime │ False │ True │ False │ False │ False │ False│ True │ True │ True │ │ 7│ 0│ False │ │{ts ' │'} │ ├──┼────────────────┼──────────────┼──────────┼────────────────────┼──────────────────────────────────────────┼──────────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┤ │30│datetimeoffset │ 34│ 10│datetimeoffset({0}) │scale │System.DateTimeOffset │ False │ True │ False │ False │ False │ False│ True │ True │ True │ │ 7│ 0│ False │ │{ts ' │'} │ └──┴────────────────┴──────────────┴──────────┴────────────────────┴──────────────────────────────────────────┴──────────────────────┴────────────────────┴────────────┴────────────────┴──────────────┴──────────────────────┴──────┴──────────┴────────────┴────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴──────────────┴──────────────┘
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:52:186楼 得分:0
    SqlServer,ODBC

    XML code
    ┌──┬──────────────────┬──────────────┬──────────┬────────────┬────────────────┬────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┬────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│CreateFormat│CreateParameters│ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ SQLType│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 1│bigint │ 1│ 19│ │ │System.Int64 │ False │ │ False │ True │ False │ False│ True │ True │ False │ False │ 0│ 0│ │ │ │ │ -5│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 2│bigint identity │ 1│ 19│ │ │System.Int64 │ True │ │ False │ True │ False │ False│ False │ True │ False │ False │ 0│ 0│ │ │ │ │ -5│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 3│sql_variant │ 2│ 8000│ │ │System.Object │ False │ │ False │ True │ False │ False│ True │ True │ False │ │ 0│ 0│ │ │ │ │ -150│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 4│binary │ 2│ 8000│ │length │System.Byte[] │ False │ │ False │ True │ False │ False│ True │ True │ False │ │ │ │ │ │0x │ │ -2│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 5│timestamp │ 2│ 8│ │ │System.Byte[] │ False │ │ False │ True │ False │ False│ False │ True │ False │ │ │ │ │ │0x │ │ -2│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 6│bit │ 3│ 1│ │ │System.Boolean │ False │ │ False │ True │ False │ False│ True │ True │ False │ │ 0│ 0│ │ │ │ │ -7│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 7│char │ 4│ 8000│ │length │System.String │ False │ │ False │ True │ False │ False│ True │ True │ True │ │ │ │ │ │' │' │ 1│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 8│datetime │ 5│ 23│ │ │System.DateTime │ False │ │ False │ True │ False │ False│ True │ True │ True │ │ 3│ 3│ │ │' │' │ 93│ └──┴──────────────────┴──────────────┴──────────┴────────────┴────────────────┴────────────────┴────────────────────┴────────────┴────────────────┴──────────────┴──────────────────────┴──────┴──────────┴────────────┴────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴──────────────┴──────────────┴────────┘
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:54:437楼 得分:0
    XML code
    ┌──┬──────────────────┬──────────────┬──────────┬────────────┬────────────────┬────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┬────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│CreateFormat│CreateParameters│ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ SQLType│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │ 9│smalldatetime │ 5│ 16│ │ │System.DateTime │ False │ │ False │ True │ False │ False│ True │ True │ True │ │ 0│ 0│ │ │' │' │ 93│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │10│decimal │ 6│ 38│ │precision,scale │System.Decimal │ False │ │ False │ True │ False │ False│ True │ True │ False │ False │ 38│ 0│ │ │ │ │ 3│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │11│money │ 6│ 19│ │ │System.Decimal │ False │ │ False │ True │ True │ False│ True │ True │ False │ False │ 4│ 4│ │ │$ │ │ 3│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │12│smallmoney │ 6│ 10│ │ │System.Decimal │ False │ │ False │ True │ True │ False│ True │ True │ False │ False │ 4│ 4│ │ │$ │ │ 3│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │13│decimal() identity│ 6│ 38│ │precision │System.Decimal │ True │ │ False │ True │ False │ False│ False │ True │ False │ False │ 0│ 0│ │ │ │ │ 3│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │14│numeric │ 7│ 38│ │precision,scale │System.Decimal │ False │ │ False │ True │ False │ False│ True │ True │ False │ False │ 38│ 0│ │ │ │ │ 2│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │15│numeric() identity│ 7│ 38│ │precision │System.Decimal │ True │ │ False │ True │ False │ False│ False │ True │ False │ False │ 0│ 0│ │ │ │ │ 2│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │16│float │ 8│ 53│ │ │System.Double │ False │ │ False │ True │ False │ False│ True │ True │ False │ False │ │ │ │ │ │ │ 6│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼────────────┼────────────────┼──────────────┼──────────────────────┼──────┼──────────┼────────────┼────────────────────┼──────────┼────────────┼────────────┼──────────────────┼──────────────────┼──────────────┼──────────────┼────────┤ │17│image │ 9│2147483647│ │ │System.Byte[] │ False │ │ False │ False │ False │ True │ True │ False │ False │ │ │ │ │ │0x │ │ -4│ └──┴──────────────────┴──────────────┴──────────┴────────────┴────────────────┴────────────────┴────────────────────┴────────────┴────────────────┴──────────────┴──────────────────────┴──────┴──────────┴────────────┴────────────────────┴──────────┴────────────┴────────────┴──────────────────┴──────────────────┴──────────────┴──────────────┴────────┘
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-25 16:56:208楼 得分:0
    XML code
    ┌──┬──────────────────┬──────────────┬──────────┬────────────┬────────────────┬────────────────┬────────────────────┬────────────┬────────────────┬──────────────┬──────────────────────┬──────┬──────────┬────────────┬────────────────────┬──────────┬────────────┬────────────┬──────────────────┬──────────────────┬──────────────┬──────────────┬────────┐ │NO│ TypeName │ProviderDbType│ColumnSize│CreateFormat│CreateParameters│ DataType │ IsAutoIncrementable│ IsBestMatch│ IsCaseSensitive│ IsFixedLength│ IsFixedPrecisionScale│IsLong│IsNullable│IsSearchable│IsSearchableWithLike│IsUnsigned│MaximumScale│MinimumScale│ IsConcurrencyType│IsLiteralSupported│ LiteralPrefix│ LiteralSuffix│ SQLType│ ├──┼──────────────────┼──────────────┼──────────┼────────────┼────────────────┼────────────────┼────────────────────┼──────────