首页 新闻 会员 周边

关于数据库中XML的读取后应该以什么类型的数据保存在Model中呢?

0
悬赏园豆:50 [已关闭问题]

在A库中有个B表,B表中有个C字段。C字段的数据类型是XML。

 

问题补充: using System; using System.Xml; using System.Data.SqlTypes; namespace LetsYY.Model { /// <summary> /// 实体类Users 。(属性说明自动提取数据库字段的描述信息) /// </summary> [Serializable] public class Users { public Users() {} #region Model private int _userid; private SqlXml _configuration; /// <summary> /// /// </summary> public int UserId { set{ _userid=value;} get{return _userid;} } public SqlXml configuration { set{ _configuration=value;} get{return _configuration;} } /// <summary> /// /// </summary> public DateTime? AddTime { set{ _addtime=value;} get{return _addtime;} } #endregion Model } } 这上面的configuration就是对应数据库里面一个字段,这个字段是XML类型的.现在定义MODEL时到底定义为C#的什么类型好呢?
rock.dean的主页 rock.dean | 初学一级 | 园豆:152
提问于:2010-01-12 15:40
< >
分享
其他回答(1)
0

返回的是XML,程序里用XmlDocument吧

齐.net | 园豆:1421 (小虾三级) | 2010-01-12 16:03
或者是以string返回,用XmlDocument Load
支持(0) 反对(0) 齐.net | 园豆:1421 (小虾三级) | 2010-01-12 16:10
0

System.String

winzheng | 园豆:8797 (大侠五级) | 2010-01-12 23:39
用string,就不方便对xml node 的操作了。
支持(0) 反对(0) rock.dean | 园豆:152 (初学一级) | 2010-01-14 08:41
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册