Need help with collection serialization

Can some Please tell me why the following collection is not XML
Serializable:

Imports System.Xml
Imports System.Runtime.Serialization

Namespace MyNamespace
<Serializable()> Public Class SpecialResult
        Private m_SpecialID As Integer
        Private m_Description As String
        Private m_Adjustment As Decimal

        Public Property SpecialID() As Integer
            Get
                Return m_SpecialID
            End Get
            Set(ByVal Value As Integer)
                m_SpecialID = Value
            End Set
        End Property

        Public Property Description() As String
            Get
                Return m_Description
            End Get
            Set(ByVal Value As String)
                m_Description = Value
            End Set
        End Property
        Public Property Adjustment() As Decimal
            Get
                Return m_Adjustment
            End Get
            Set(ByVal Value As Decimal)
                m_Adjustment = Value
            End Set
        End Property

        Public Sub New()
            'for serialization
        End Sub
    End Class

<Serializable()> _
Public Class ZCollection
    Inherits System.Collections.Specialized.NameObjectCollectionBase

    Public Sub New()
         MyBase.New()
    End Sub

    Protected Sub New(ByVal info As SerializationInfo, ByVal context As
StreamingContext)
            MyBase.New(info, context)
    End Sub

     Public Sub Add(ByVal result As SpecialResult)
            Dim obj As SpecialResult
            Dim key As String

            key = Now.ToString

            obj = CType(MyBase.BaseGet(key), SpecialResult)
            If obj Is Nothing Then
                MyBase.BaseAdd(key, result)
            End If
      End Sub

      Public Sub Add(ByVal result As SpecialResult, ByVal key As
String)
            Dim obj As SpecialResult

            obj = CType(MyBase.BaseGet(key), SpecialResult)
            If obj Is Nothing Then
                MyBase.BaseAdd(key, result)
            End If
      End Sub

Public Sub Add(ByVal result As SpecialResult, ByVal enumKey As
Enums.EKeys, ByVal specialID As Integer)
            Dim obj As SpecialResult
            Dim key As String

            key = enumKey.ToString & "_" & specialID

            obj = CType(MyBase.BaseGet(key), SpecialResult)
            If obj Is Nothing Then
                MyBase.BaseAdd(key, result)
            End If
        End Sub
Default Public Overloads ReadOnly Property Item(ByVal enumKey As
Enums.EKeys, ByVal specialID As Integer) As SpecialResult

            Get
                Try
                    Dim key As String

                    key = enumKey.ToString & "_" & specialID

                    Return CType(MyBase.BaseGet(key), SpecialResult)
                Catch ex As Exception

                End Try
            End Get
        End Property

Default Public Overloads ReadOnly Property Item(ByVal Index As Integer)
As SpecialResult

            Get
                Try
                    Return CType(MyBase.BaseGet(Index - 1),
SpecialResult)
                Catch ex As Exception

                End Try
            End Get
        End Property
        Default Public Overloads ReadOnly Property Item(ByVal Key As
String) As SpecialResult

            Get
                Try
                    Return CType(MyBase.BaseGet(Key), SpecialResult)
                Catch ex As Exception

                End Try
            End Get
        End Property
        Public Shadows ReadOnly Property Count() As Integer
            Get
                Return MyBase.Count
            End Get
        End Property

    End Class

End Namespace

0
jsmith72 (1)
1/10/2007 3:00:13 PM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
185 Views

Similar Articles

[PageSpeed] 17

Reply:

Similar Artilces:

Need Help #2
I have recently fallin' on hard economic times, I would really like you all to send me donations so I may purchase the new Office 2003 Professional Suite next month. Please send funds to Excel Guru P.O. Box 321 Grosse Pointe, MI Thank you. What's the zip code there? >-----Original Message----- >I have recently fallin' on hard economic times, I would >really like you all to send me donations so I may >purchase the new Office 2003 Professional Suite next >month. Please send funds to > Excel Guru > ...

Need better way to provision AD accounts that are to have mailboxes
The exchange admins in my company have come up with a way for the sys admins to assign the user's mailbox store location. It's based off of last name. For example, if your last name starts with letter A, you go on Storage Group 1, Mailbox Store A, if your last name starts with letter B, you go on Storage Group 1, Mailbox Store B, if your last name starts with letter E, you go on Storage Group 2, Mailbox Store A, etc.... This is, I believe, and administrative nightmare. Is there a better way to provision AD accounts that are to have mailboxes? If it works for you and them, then al...

Can I Order My Collection?
All, If I want to build a collection in a specific order, and I'm filling it from a TableAdapter whose source query I can not change, how would I put it in the order of one of the columns in the underlying query? I've tried various things as spelled out in my book and other sources, but nothing seems to "recognize" a column name. Here's what I have; Me.QRY_ButtonsTableAdapter.ClearBeforeFill = True Me.QRY_ButtonsTableAdapter.Fill(Me.L55TimerDataSet.QRY_Buttons) Dim Row As Integer = 0 Dim ButRecds = L55TimerDataSet.Tables("...

Help #5
Below is what I have on a spreadsheet. I need sum up the P&L values for each period (month) by counterparty. If the sum is positive it is an AR, If negative an AP. Anyone know a quick way to do this? Period Counterpart P/L AR AP Jul-05 Coke 5000 Jul-05 Coke 10000 In D2 =IF(C2>0,"AR",) In E2 =IF(C2>0,"AP",) Then highlight D2 to E3 and hit control d "Tim T via OfficeKB.com" wrote: > > Below is what I have on a spreadsheet. I need sum up the P&L values for each > period (month) by count...

HELP ME RESTORE OUTLOOK
I accidentally removed my Outlook e-mail program with the add/remove wizard. I know it's still on the computer, but just HOW do I get it back? HELP ME RESTORE OUTLOOK wrote: || I accidentally removed my Outlook e-mail program with the add/remove || wizard. I know it's still on the computer, but just HOW do I get it || back? If you used Add/remove then it's NOT on the computer. You need to re-install it from your Office CD -- Interim Systems and Management Accounting Gordon Burgess-Parker Director www.gbpcomputing.co.uk HELP ME RESTORE OUTLOOK wrote: > I accidentally r...

Help Creating A Formula #2
I need to make a formula for alook up. The first spreadsheet i inventory, the second one is pg 103 strapping. I want to enter the fee and inches for pg 103 on the inventory and have it look up the feet an inches on strapping chart and enter the appropriate gallons in column Attachment filename: p & g 101 strapping.zip Download attachment: http://www.excelforum.com/attachment.php?postid=50210 -- Message posted from http://www.ExcelForum.com ...

Help creating a script in SQL or Calculated field in Crystal
How do I take this script and manipulate it to give me one long string with static text as well as SQL data in specific positions within the string. Example result: Positions / Data: 1-3 / 173 (Static text) 4-6 / spaces 7-10 / "X_UPR30300"."YEAR1", (has to show up as 2007. Showing up as 2,007) 11 / 4 (Static text) 12-22 / "UPR00100"."SOCSCNUM" 23-57 / "UPR00100"."LASTNAME" 58-92 / "UPR00100"."FRSTNAME" 93 / "UPR00100"."MIDLNAME" 94-120 / "UPR00102"."ADDRESS1" 121-148 / &q...

Collection with members of Great_Plains
Hello. How I can load or fill a collection with the members of project Great_Plains that correspond to the added fields? Thanks. ...

Excel formula help #4
Hello! Can somone help me with this formula 2004:21-0-1-1-11 in this cell i wan't to get out "21" 2005:2-0-0-0-1 in this cell i wan't to get out "2" My result from the formula is "-21" and ":2-" is there a formula that i can use on both and get the result "21" and "2"? I want to add the together at the end and get the result "23" but with : and - i only get error. -- johhny ------------------------------------------------------------------------ johhny's Profile: http://www.excelforum.com/member.php?act...

Need an unbound text box and command button (Search)
I need to create an unbound text box with a command button (Search) on my form which will enable the user to find the current record for a space no. I would like the user to only have to type in the space no. My fields are: SpaceNo Current "Yes" I am not experienced at writing code. Thanks so much. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200911/1 On Wed, 25 Nov 2009 23:09:36 GMT, "Uschi via AccessMonster.com" <u25116@uwe> wrote: If you don't write code, it may be easier to instruc...

Linking text within Excel-- help!
I have a mailing list that I will be importing into Excel, and am trying to link the names on the list to invoices for those people on the list. Can I do this in Excel by using links? The Excel help feature only seems to describe links with figures (numbers), not text. e.g. Mr. Bill Jones, 123 Main Street, Middletown, OK 40404 (each word in its own cell in the mailing list worksheet) ....would link to a worksheet that had Bill Jones' name and address but also indicted that he purchased a $100 product on June 15 and his bill has been paid in full. My questions: 1. Each of the 300 or...

Manual Sales Methodology -- Need Help
Hi, Here is my situation. We are trying to implement a manual sales methodology. Basically I have a dropdown list called "Sales Stage" with values entitles "Stage 1", "Stage 2" and "Stage 3". I need the values here to effect the sales pipeline and the sales pipeline report. The other issue is that a lead can advance or retreat in the sales cycle. Meaning it could go from Stage 1 to Stage 2 and then back to Stage 1 or could go Stage 1 to Stage 3 and then to Stage 2. I know I need a workflow setup (as just effecting the "stepname&quo...

need formula help
I'm trying to have a formula do 3 scenerios in one cell and have a partial formula working: IF(AND(G39>30, G39<=7),3000) which equates to if cell G39 is greater than 0 and less than or equal to 7 use 3000. I would like to continue the formula that if G39 is greater than 7 and less than 14 use 5000 and if G39 is greater than 14 use 7500. How can I do this? Hi, =IF(AND(G39>0, G39<=7),3000,IF(AND(G39>7, G39<=14),5000,if(G39>14,7500))) "tom" wrote: > I'm trying to have a formula do 3 scenerios in one cell and have a partial > form...

Formula Help #66
I need help with a formula. I can't figure out how to calculate for missing number. '05 we sold x units, I know we had a X% increase over '04 so what wa the '04 sales? Column A = '05 Columb B = '04 Column C = % increas -- bab ----------------------------------------------------------------------- babz's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2781 View this thread: http://www.excelforum.com/showthread.php?threadid=49307 '04 sales = '05 sales / 1.X% increase Vaya con Dios, Chuck, CABGx3 "babz" wrote: >...

Need help, pls, with contacts...
As I enter names in Outlook 2000, I would like their title to appear before their name in both the contact listing AND when I send an email.. example... Dr. Joe Smith... instead of just Joe Smith.. And having to click 'Full Name' to reveal the title of Dr. Also, is their a way to add additional titles to the dropdown list? I also deal with religious that use Sr. (Sister) and Fr. (Father), as well as Deacon... Thank You! -- B'Regards, Vinnie ...

Header file help
Sir, I am presently doing an application work in VC++.I am doing the coding for "Virtual CD ROM Drive".In this I am not getting one headerfile i.e "#include<ntddcdrm.h>".In msdn you mentioned the path windows nt DDk which I am not having.I am kindly requesting you to provide this header file through mail. thanking you your faithfully Kiran. Hello, You downloads ntddcdrm.h from the following link, http://cvs.winehq.com/cvsweb/~checkout~/wine/include/ntddc drm.h?rev=1.3&content-type=text/plain Regards, R.Selvam >-----Original Message----- >Sir,...

Strange "button"
I got an .xls from someone and had to populate some cells with data extracted from the application database, which I did OK. My problem is the fact that the .xls came with something like a button (not created by me) that I want to delete, but simply can't. I can't select it, like I can do with the forms controls I'm used to work with, although it appears to be a normal command-button. What could that object be? And how could I simply get rid of that? Ok, I finally found the answer. "BEDE" wrote: > I got an .xls from someone and had to populate some cells with d...

You need more memory or system resources
I have outlook 2000 connected to exchange server 5.5. Whenever I right click on the Outlook icon and go to properties, I get the error message "you need more memory or system resources." I scoured the internet and the info I'm getting is that it has something to do with outlook express 5 and it's a mapi setting that should be unchecked. I have outlook express 6 installed and I don't see that option anywhere. I turn off and on my computer, I don't have any programs running on startup and the first thing I do is try to get into properties and it still gives me th...

border help
When I go to print my page with my border on it, it prints the top and sides but not the bottom, anyone know what I'm doing wrong? I have tried to change the margins as well but I get the same thing. On Mon, 30 Nov 2009 18:25:01 -0800, michelle <michelle@discussions.microsoft.com> wrote: >When I go to print my page with my border on it, it prints the top and sides >but not the bottom, anyone know what I'm doing wrong? I have tried to change >the margins as well but I get the same thing. See http://www.word.mvps.org/FAQs/Formatting/BottomsDontPrint.htm ...

Will pay for need help and occasional advise on using excel ....
"sorry if this is off post ...will be my last" Thx in advance for your help and interest. i am an independant oil and gas consultant and have a fair amount of computer experience but, am absolutely lost when it comes to data bases .... i found a database online (in .php format) that contains names, addresses, phone numbers, fax numbers and email addresses of companies and people within the oil and gas industry ... i want to be able to utilize this db in excel so i can sort certain companies or people and use excels "mail merge" system to send them emails. ...

Help with filtering
I am having trouble with Exchange sender filtering and Health Monitor Alerts. I configured my only Exchange server to block emails from *@mydomain.com to prevent spammers from spoofing emails from within my domain. Unfortunately this blocks the servers Health Monitoring Alerts because the emails are from administrator@mydoamin.com. Is there a was I can have my cake (blocked spoofed emails) and eat it (send performance alerts) too? -John Add administrator@mydomain.com to the safe senders list. -- Cheers, Bhalchandra, MCSE-Messaging "John" wrote: > I am having troub...

Domain-HELP
My question is: I have a domain (MOM) and two child domains (KID1 and KID2). If I create a user on KID1 or KID2 and place the mailbox on MOM. The problem is: the mailbox will not shown in System's manager but I was able to send an email to that mailbox without the email coming back. ALSO, the user's name will not shown up in the GAL. Help me here.... BJ: Check your RUS settings. If you don't know what that is, then that's probably what's causing this issue, so read up on it. You need to have RUS set up for the subdomains since they don't have Exchange servers. ...

Outlook 2000 HELP ! ! !
I had to un-install Outlook thru the add/remove program ( Office 2000 Premium ) because of a problem I was having on my hard drive. The problem being corrected, now I want to install Office back. When I try to do an install, it keeps telling me that I have to reboot all the time, so I do several re-boots and I still can not get it to install. WHAT can I do here to get it to install ? ? ? ? Any help would be appreciated because I am new to this stuff. Norm at wahkona1 at hotmail dot com ...

I need .5 instead of .3 on total time on time sheet
I need to make the total time at the end of the week show .5 (39.5 hours) not .3 (39.3 hours) What formula? What value of the source cells? What formatting? -- Kind Regards, Niek Otten Microsoft MVP - Excel "Anthonyt65" <Anthonyt65@discussions.microsoft.com> wrote in message news:0B4BFDEF-6625-42E9-ACC3-143C5C8C8832@microsoft.com... >I need to make the total time at the end of the week show .5 (39.5 hours) > not .3 (39.3 hours) try =MROUND(F2,0.5) -- Don Guillett SalesAid Software donaldb@281.com "Anthonyt65" <Anthonyt65@discussions.microsoft.c...

I need to host a 2nd domain on my Exchange server.
Hi, my current email is ashrafvc@abc.com on a single domain with exchange 2003. We have currently aquired another company and I need to add new email account on my same exchange server with different domain name, for example abc@mbc.com I refer some article suggesting to play around with recepient policy but somehow it just seem to be not working for me. Is there a better way or right solution for this ? Please help. Thanks & Regards, Ashraf http://www.petri.co.il/configure_exchange_2000_2003_to_receive_email_for_other_domains.htm That should give you the basics. Make sure the MX rec...