• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

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

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; }

        [IgnoreNulls]
        [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 "";

            data.

            //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?

Thanks,

Dan
0
danielolorenz
Asked:
danielolorenz
  • 3
1 Solution
 
Bob LearnedCommented:
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?
0
 
danielolorenzAuthor Commented:
the solution: data[0].Action
0
 
danielolorenzAuthor Commented:
good
0
 
danielolorenzAuthor Commented:
yes
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now