English 中文(简体)
Net Serialization, XmlDataReader, a Database and the StonesAttribute!
原标题:.Net Serialization, XmlDataReader, a SQL Database and the FlagsAttribute!

迅速概述我的情况:

我正在根据一份N-Tier的传闻开展工作,该信在很大程度上依靠序列化,主要以序列化的方式与数据库互动,在储存程序中插入、更新和读为XML。

对于一些较小的数据类别,我只是利用ExecuteNon Query、阅读器等与数据互动,因为数据比较容易,但我遇到了一个问题。

使用参数,将数据输入数据库,其中一部分数据是Enums(在亚洲开发银行中作为斜体储存)的,其附着旗帜。 On:

<Flags()> _
Public Enum Fruit As Integer
    <Description("None"), XmlEnum("0")> None = 0
    <Description("Apple"), XmlEnum("1")> Apple = 1
    <Description("Banana"), XmlEnum("2")> Banana = 2
    <Description("Orange"), XmlEnum("4")> Orange = 4
End Enum

重新计算的价值可能为1,3,7等,并插入数据库中,不使用序列化,但作为使用ExecuteXmlReader(填充XmlReader物体)的较大类别的一部分加以重新计算,然后需要加以淡化,例如,由于7个原因,无法造成验证错误: 7 对水果来说不是有效价值,因为它期望它按以下格式进行分类:

<fruitOptions>1 2 4<fruitOptions>

所有这一切都没有什么混淆,我或许可以通过在数据库中储存1,2,4格式,但不幸的是,没有目前处于的状态。

是否有人对此有任何想法?

最佳回答

您将不得不请您的外交部或您重新使用所储存程序的作者。 他们似乎指出,这个领域并不是一个整体,而是一份清单。

问题回答

暂无回答




相关问题
Finding the Highest Value in an Enumeration

I m writing a method which determines the highest value in a .NET enumeration so I can create a BitArray with one bit for each enum value: pressedKeys = new BitArray(highestValueInEnum<Keys>());...

Conversion of Enum to Enumerable

To convert Enum to Enumerable ,I use public enum Flags { Trivial=1, Minor, Major, Critical } IEnumerable<int> n = Enumerable.Range((int)Flags.Trivial, (...

Subclass check, is operator or enum check

A couple of friends was discussing the use of inheritance and how to check if a subclass is of a specific type and we decided to post it here on Stack. The debate was about if you should implement a ...

Enum scoping issues

I try to keep things as local as possible, so I put enums at class scope, even if they are shared between two classes (I put it in the class that "goes better" with it.) This has worked out great, but ...

How do I sort enum members alphabetically in Java?

I have an enum class like the following: public enum Letter { OMEGA_LETTER("Omega"), GAMMA_LETTER("Gamma"), BETA_LETTER("Beta"), ALPHA_LETTER("Alpha"), private final String ...

C++ enum value initialization

I have an enum declared in my code as: enum REMOTE_CONN { REMOTE_CONN_DEFAULT = 0, REMOTE_CONN_EX_MAN = 10000, REMOTE_CONN_SD_ANNOUNCE, REMOTE_CONN_SD_IO, REMOTE_CONN_AL, ...

WCF: Enforce equal DataContracts on both sides

I m wondering if it is possible to have WCF make sure that the DataContracts on both sides of a connection are exactly the same (and throw an exception when trying to connect if they are not). For ...

热门标签