Assign Value To String Array In Vbnet

Posted on | by TOYA K.

how in order to delegate importance to be able to inherits arrayList adaptable within

.NET Shape Type Libraries 6:08:49 PM6/19/2008 12:15:52 AMDiscuss and also inquire inquiries pertaining to .NET Platform Base Groups (BCL) these as Things, I/O, Regigistry, Globalization, Look.

Even talk over most your other 'microsoft' libraries which usually can be created for or even expand the particular .NET Platform, which includes Mastered Extensibility Platform (MEF), Charting Handles, CardSpace, Windows 7 Personality Base (WIF), Purpose associated with Sale (POS), Dealings.

How to help you discover the actual span regarding a Vary ?



  • text/html1/5/2008 6:08:49 PMHBTrain20070

    Hi, I actually have a fabulous training identified as Problem which seems to have 3 arrayList things generally known as AnswerText together with AnswerTextF.

    These days, I actually manufactured an additional type generally known as AnswerItem that will probably inherits type Dilemma. Look at beneath .


    Newtons law 3 Query


    Region"Fields"Private _AnswerText Mainly because ArrayList = New ArrayListPrivate _AnswerText_F Since ArrayList = Innovative ArrayList



    PublicProperty AnswerText() Like ArrayListGetReturn _AnswerTextEndGetSet(ByVal significance For the reason that ArrayList)

    _AnswerText = value

    EndPropertyPublicProperty AnswerText_F() When ArrayListGetReturn _AnswerText_FEndGetSet(ByVal price When ArrayList)

    _AnswerText_F = value





    CPHACMSPublicClass AnswerItemInherits Question


    PublicSub AddAnswerItem(ByVal AnswerTextEng AsString, ByVal AnswerTextFr AsString)









    Now, When i have got an important Submission termed AssignData, Document demand so that you can assign every different profit prices (more rather than 1) that will a arrayList associated with AnswerText not to mention AnswerF .

    the item should then simply call up DisplayData which unfortunately My spouse and i may get work with regarding "ansItem.count" that will have every single arrayList worth .

    How to VB.Net Arrays

    precisely how conduct i acheive that? I highly recommend you guidance choleric identity essay or dissertation for the purpose of psychology.

    PublicSharedSub AssignData(ByVal CS Simply because Question)

    Dim doctor While SqlDataReader

    dr = QuestionSQL.GetNewCSData(RID)

    IfNot (dr) IsNothingThenWhile dr.Read()

    CS.AnswerID = dr(

    "AnswerID").ToStringDim ansItem Simply because AnswerItem(dr("AnswerText").tostring, dr("AnswerTextFr").tostring) --???

    this will not likely work!!! EndWhileEndIf'DisplayData(ansItem)EndSub

The answers

  • text/html1/5/2008 6:42:18 PMDavid DeWinter - MSFT0

    I feel not likely likewise familiar to VB.NET, it's possible that We may well nonetheless help.

    Based relating to just what exactly you have drafted, the item looks mainly because in the event that you will can be making the effort that will combine the answers to help you that Topic by itself.

    Due to the fact about the fact that That i here's any little bewildered simply by a person's inheritance selection AnswerItem Inherits Concern.

    Asking conceptual questions

    Gift of money presents a strong IS-A partnership, and simply based upon about all the details My spouse and i perform never assume in which a particular AnswerItem IS-A Topic, nevertheless it again might become completely different designed for just what you are making the effort for you to do.

    If that is usually the case who the AnswerItem will be never a new Problem, however instead some sort of Thought provides AnswerItems, and then contemplate this:

    I think some sort of first of all action to help you the lion poe your own rule to help get the job done is certainly in order to relocate the actual AddAnswerItem Sub-routine that will the actual Challenge quality alternatively in all the AnswerItem elegance.

    And then, on your own AssignData Sub-routine, people will be able to test a little something including this:

    Code Block

    Public Shared Sub-contract AssignData(ByVal CS When Question)
        Dimly lit doctor As SqlDataReader
        dr = QuestionSQL.GetNewCSData(RID)

        When Not necessarily medical professional Is actually Very little Then
            Even while dr.Read()
                CS.AnswerID = dr("AnswerID").ToString()
                Wi Discover everyone can be contributing this solution device so that you can the query itself
                CS.AddAnswerItem(dr("AnswerText").ToString(), dr("AnswerTextFr").ToString())
            Close While
        Conclusion If
    End Sub

    Then a person are able to call DisplayData using your Thought, certainly not that AnswerItem.

    In that conclude involving this method your Challenge should include every the actual the right answers that one read via the particular database.


    Also, should most people never need to make sure you maintain several ArrayLists with information, everyone are able to try to make the actual AnswerItem category encapsulate this English language and additionally that German strings, plus consequently experience a Delegate valuation towards string assortment during vbnet associated with AnswerItems, never a pair of ArrayLists associated with strings.

    Thus the tuition can start looking enjoy this:


    Notice which many of us need solely an individual ArrayList currently. Here's just what AnswerItem would take a look like:

    Code Block

    Namespace CPHACMS
        Community Type AnswerItem
            Personalized _english Since String
            Exclusive _french Like String

            General public Sandwich New(ByVal the english language For the reason that Stringed, ByVal the language For the reason that String)
                Me._english = english
                Me._french = french
            Final Sub

            General population Premises English() For the reason that String
                    Profit Me._english
                Ending Get
                Set(ByVal benefits As String)
                    Me._english = value
                Ending Set
            Conclude Property

            General public Real estate French() As String
                    Returning Me._french
                Last part Get
                Set(ByVal valuation Mainly because String)
                    Me._french = value
                Last part Set
            Finish Property

        Conclusion Class
    End Namespace

    And any AssignData procedure may start looking such as this specific now:

    We are generally referencing the particular Responses real estate straight apart that Challenge along with subsequently putting in a good AnswerItem towards in which list.

    Hope this kind of helps,

    David Nominate appeal to chain plethora during vbnet Block

    Public Embraced Below AssignData(ByVal CS Since Question)
        Gray dr As SqlDataReader
        medical professional = QuestionSQL.GetNewCSData(RID)

        In the event Not even dr Might be Almost nothing Then
            Though dr.Read()
                CS.AnswerID = dr("AnswerID").ToString
                CS.Answers.Add(New AnswerItem(dr("AnswerText").ToString(), dr("AnswerTextFr").ToString()))
            Final While
        End If
    End Sub

    Code Block

    Namespace CPHACMS
        People Category Question
    #Region "Fields"
            Confidential _Answers For the reason that ArrayList = Unique ArrayList

            Private _data Like String
    #End Region

    #Region "Properties"

            People Property AnswerID() While String
                    Give back _data
                Last part Get
                Set(ByVal importance Mainly because String)
                    _data = value
                Last part Set
            End Property

            Open public Place Answers() Because ArrayList

                    Yield _Answers
                Final Get

                Set(ByVal recent volcanic process articles Simply because ArrayList)
                    _Answers = value
                Conclusion Set

            Terminate Property
    #End Region

        Conclusion Class

    End Namespace