枚举在DataSet中 [英] Enum in DataSet

查看:182
本文介绍了枚举在DataSet中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DataSet连接我的C#程序与SQL数据库。我想要其中一列作为枚举,我希望它作为我的代码中的枚举。我该怎么做?

解决方案

我不是要破坏每个人的泡沫,而是可以轻松地将整数映射到枚举使用强类型数据集。我一直都这样做而不是在这里输入整个事情,我创建了一个我的博客上的条目详细描述了如何完成这个。


I'm using DataSet to connect my C# program with SQL database. I want one of the columns to be an enumeration and I want it to act as an enum in my code. How can I do this?

解决方案

I don't mean to burst everyone's bubble, but you can easily map an integer to an Enum using a Strongly Typed DataSet. I do it all the time. Rather than type the whole thing out here I have created an entry on my Blog describing in detail how to accomplish this.

这篇关于枚举在DataSet中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆