/// <summary>
        /// This is where the data is read from the input buffer
        /// </summary>
        /// <param name="inputID"></param>
        /// <param name="buffer"></param>
        public override void ProcessInput(int inputID, PipelineBuffer buffer)
        {
            string sharepointUrl = "";
            string sharepointList = "";
            string sharepointListView = "";
            short batchSize = (short)2;
            Enums.BatchType batchType = Enums.BatchType.Deletion;

            if (!buffer.EndOfRowset)
            {
                // Queue the data up for batching by the sharepoint accessor object
                var dataQueue = new List<Dictionary<string, FieldValue>>();
                while (buffer.NextRow())
                {
                    var rowData = new Dictionary<string, FieldValue>();
                    foreach (var fieldName in _bufferLookup.Keys)
                    {
                        if (buffer.IsNull(_bufferLookup[fieldName]))
                        {
                            // Do nothing, can ignore this field
                        }
                        else
                        {
                            FieldValue filedObj = new FieldValue();
                            switch (_bufferLookupDataType[fieldName])
                            {
                                case DataType.DT_STR:
                                case DataType.DT_WSTR:

                                    filedObj.value = buffer.GetString(_bufferLookup[fieldName]);
                                    filedObj.type = "string";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_NTEXT:
                                    int colDataLength = (int)buffer.GetBlobLength(_bufferLookup[fieldName]);
                                    byte[] stringData = buffer.GetBlobData(_bufferLookup[fieldName], 0, colDataLength);

                                    filedObj.value = Encoding.Unicode.GetString(stringData);
                                    filedObj.type = "string";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_R4:
                                    filedObj.value = buffer.GetSingle(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Double";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_CY:

                                    filedObj.value = buffer.GetDecimal(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Double";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_R8:
                                    filedObj.value = buffer.GetDouble(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Double";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_UI1:
                                case DataType.DT_I1:
                                case DataType.DT_BOOL:

                                    filedObj.value = buffer.GetBoolean(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Boolean";
                                    rowData.Add(fieldName, filedObj);

                                    break;
                                case DataType.DT_UI2:
                                case DataType.DT_I2:

                                    filedObj.value = buffer.GetInt16(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Int64";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_UI4:
                                case DataType.DT_I4:

                                    filedObj.value = buffer.GetInt32(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Int64";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_UI8:
                                case DataType.DT_I8:

                                    filedObj.value = buffer.GetInt64(_bufferLookup[fieldName]).ToString(_culture);
                                    filedObj.type = "Int64";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_GUID:

                                    filedObj.value = buffer.GetGuid(_bufferLookup[fieldName]).ToString();
                                    filedObj.type = "String";
                                    rowData.Add(fieldName, filedObj);
                                    break;
                                case DataType.DT_DBTIMESTAMP:

                                    filedObj.value = buffer.GetDateTime(_bufferLookup[fieldName]).ToString("u").Replace(" ", "T");
                                    filedObj.type = "Datetime";
                                    rowData.Add(fieldName, filedObj);

                                    break;

                                case DataType.DT_DATE:
                                    
                                    filedObj.value = buffer.GetDateTime(_bufferLookup[fieldName]).ToString("yyyy-MM-dd");
                                    filedObj.type = "Datetime";
                                    rowData.Add(fieldName, filedObj);

                                    break;
                            }
                        }
                    }
                    dataQueue.Add(rowData);
                }

                bool fireAgain = false;


                Enums.TrueFalseValue removeRecords = (Enums.TrueFalseValue)ComponentMetaData.CustomPropertyCollection[C_REMOVERECORDS].Value;
                if (removeRecords == Enums.TrueFalseValue.True)
                ClearRows();

  
                if (dataQueue.Count() > 0)
                {
                    System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
                    timer.Start();
                    System.Xml.Linq.XElement resultData;


                    CreateDataset(dataQueue);
                    AddClassRows(dataQueue);

                    timer.Stop();
                }
                else
                {
                    ComponentMetaData.FireInformation(0, ComponentMetaData.Name,
                        "No rows found to update in destination.", "", 0, ref fireAgain);
                }

            }
        }
        /// <summary>
        /// This is where the data is read from the input buffer
        /// </summary>
        /// <param name="inputID"></param>
        /// <param name="buffer"></param>
        public override void ProcessInput(int inputID, PipelineBuffer buffer)
        {
            string sharepointUrl      = "";
            string sharepointList     = "";
            string sharepointListView = "";
            short  batchSize          = (short)2;

            Enums.BatchType batchType = Enums.BatchType.Deletion;

            if (!buffer.EndOfRowset)
            {
                // Queue the data up for batching by the sharepoint accessor object
                var dataQueue = new List <Dictionary <string, FieldValue> >();
                while (buffer.NextRow())
                {
                    var rowData = new Dictionary <string, FieldValue>();
                    foreach (var fieldName in _bufferLookup.Keys)
                    {
                        if (buffer.IsNull(_bufferLookup[fieldName]))
                        {
                            // Do nothing, can ignore this field
                        }
                        else
                        {
                            FieldValue filedObj = new FieldValue();
                            switch (_bufferLookupDataType[fieldName])
                            {
                            case DataType.DT_STR:
                            case DataType.DT_WSTR:

                                filedObj.value = buffer.GetString(_bufferLookup[fieldName]);
                                filedObj.type  = "string";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_NTEXT:
                                int    colDataLength = (int)buffer.GetBlobLength(_bufferLookup[fieldName]);
                                byte[] stringData    = buffer.GetBlobData(_bufferLookup[fieldName], 0, colDataLength);

                                filedObj.value = Encoding.Unicode.GetString(stringData);
                                filedObj.type  = "string";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_R4:
                                filedObj.value = buffer.GetSingle(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Double";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_CY:

                                filedObj.value = buffer.GetDecimal(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Double";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_R8:
                                filedObj.value = buffer.GetDouble(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Double";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_UI1:
                            case DataType.DT_I1:
                            case DataType.DT_BOOL:

                                filedObj.value = buffer.GetBoolean(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Boolean";
                                rowData.Add(fieldName, filedObj);

                                break;

                            case DataType.DT_UI2:
                            case DataType.DT_I2:

                                filedObj.value = buffer.GetInt16(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Int64";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_UI4:
                            case DataType.DT_I4:

                                filedObj.value = buffer.GetInt32(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Int64";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_UI8:
                            case DataType.DT_I8:

                                filedObj.value = buffer.GetInt64(_bufferLookup[fieldName]).ToString(_culture);
                                filedObj.type  = "Int64";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_GUID:

                                filedObj.value = buffer.GetGuid(_bufferLookup[fieldName]).ToString();
                                filedObj.type  = "String";
                                rowData.Add(fieldName, filedObj);
                                break;

                            case DataType.DT_DBTIMESTAMP:

                                filedObj.value = buffer.GetDateTime(_bufferLookup[fieldName]).ToString("u").Replace(" ", "T");
                                filedObj.type  = "Datetime";
                                rowData.Add(fieldName, filedObj);

                                break;

                            case DataType.DT_DATE:

                                filedObj.value = buffer.GetDateTime(_bufferLookup[fieldName]).ToString("yyyy-MM-dd");
                                filedObj.type  = "Datetime";
                                rowData.Add(fieldName, filedObj);

                                break;
                            }
                        }
                    }
                    dataQueue.Add(rowData);
                }

                bool fireAgain = false;


                Enums.TrueFalseValue removeRecords = (Enums.TrueFalseValue)ComponentMetaData.CustomPropertyCollection[C_REMOVERECORDS].Value;
                if (removeRecords == Enums.TrueFalseValue.True)
                {
                    ClearRows();
                }


                if (dataQueue.Count() > 0)
                {
                    System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
                    timer.Start();
                    System.Xml.Linq.XElement resultData;


                    CreateDataset(dataQueue);
                    AddClassRows(dataQueue);

                    timer.Stop();
                }
                else
                {
                    ComponentMetaData.FireInformation(0, ComponentMetaData.Name,
                                                      "No rows found to update in destination.", "", 0, ref fireAgain);
                }
            }
        }