How Do You Extract Data from a structure Data[] data?

Posted on 2012-09-11
Last Modified: 2012-09-22
I have a Save method and need to extract the data from a parameter: CaseLoadData[] data.  

CaseLoadData class file is set up in this way:
 public class CaseLoadData : BusinessBase<CaseLoadData>,_ICaseLoader
        [NotNullValidator(MessageTemplate = "Action cannot be null.")]
        [RegexValidator(@"^.*\b(REOPEN SUBCASE or UPDATE SUBCASE|OPEN or CREATE AUTO SUBCASE)\b.*$", MessageTemplate = "Only characters may be entered for Action.  Example: UPDATE, CLOSE, DELETE, CREATE, OPEN, INTERACT, CREATE SUBCASE, e!)")]
        public string Action
        { get; set; }

        [RegexValidator(@"^([A-Za-z]+)$", MessageTemplate = "Only characters may be entered for Direction.  Example: INBOUND")]
        public string Direction
        { get; set; }

 public string Save(ref CaseLoadData[] data)
            return "";


            //string batchProcessId = GenerateBusinessBatchProcessId();

            int commandBindSize = (int)CSS.SSD.Enumerators.Enumerators.ApiMaxCommandBindSize.Save; //limit records per command;

            // Counting rows of data from data
            int dataCount = data.Count();

            IList<IDbCommand> commands = new List<IDbCommand>(dataCount);

            for (int i = 0; i < dataCount; i++)
            //    IEnumerable<BusinessBase> partOfCollection = collection.Skip(i * commandBindSize).Take(commandBindSize);

                OracleCommand cmd = new OracleCommand();
                cmd.BindByName = true;
                //cmd.ArrayBindCount = partOfCollection.Count();

                cmd.Parameters.Add(new OracleParameter("p_SSD_MAINT_ID", OracleDbType.Int32, commandBindSize, data.SSDMaint.ToArray(), ParameterDirection.Input));
                cmd.Parameters.Add(new OracleParameter("p_ACTION", OracleDbType.Varchar2, commandBindSize, data.Action.ToArray(), ParameterDirection.Input));      

How do I get data in from the data data structure using the CaseLoadData[] data parameter?


Question by:danielolorenz
    LVL 96

    Expert Comment

    by:Bob Learned
    It looks like you need to create OracleParameter objects, and set the parameter values from each CaseLoadData object.

    How does the object property names relate to the OracleParameter names?

    Accepted Solution

    the solution: data[0].Action

    Author Comment


    Author Closing Comment


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Article by: Ivo
    C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now