Unable to add the Custom Pipeline component in to the Visual Studio Tool Box

I have tried to create the custom Pipeline component to transfer the large message in Receive side,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;
using Microsoft.BizTalk.Message.Interop;
using Microsoft.BizTalk.Component.Interop;
namespace Sample.LargeFilesDecoder
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
[ComponentCategory(CategoryTypes.CATID_Encoder)]
[System.Runtime.InteropServices.Guid("25984614-BCFD-4c47-82FC-4A2300B76411")]
public class LargeFilesDecoder : IBaseComponent,
IComponentUI,
IComponent,
IPersistPropertyBag
#region IBaseComponent Members
public string Description
get
return "Pipeline component used to receive Larger Files through SFTP Ports";
public string Name
get
return "LargeFilesDecoder";
public string Version
get
return "1.0.0.0";
#endregion
#region IComponentUI Members
public IntPtr Icon
get
return new System.IntPtr();
public System.Collections.IEnumerator Validate(object projectSystem)
return null;
#endregion
#region IPersistPropertyBag Members
private string _largeFileLocation;
private int _thresholdSize;
public string LargeFileLocation
get { return _largeFileLocation; }
set { _largeFileLocation = value; }
public int ThresholdSize
get { return _thresholdSize; }
set { _thresholdSize = value; }
public void GetClassID(out Guid classID)
classID = new Guid("DBA77DFA-5D3E-4B85-8F78-1D6330B6BCA0");
public void InitNew()
public void Load(IPropertyBag propertyBag, int errorLog)
object val1 = null;
object val2 = null;
try
propertyBag.Read("LargeFileLocation", out val1, 0);
propertyBag.Read("ThresholdSize", out val2, 0);
catch (ArgumentException)
catch (Exception ex)
throw new ApplicationException("Error reading PropertyBag: " + ex.Message);
if (val1 != null)
_largeFileLocation = (string)val1;
if (val2 != null)
_thresholdSize = (int)val2;
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties)
object val1 = (object)_largeFileLocation;
propertyBag.Write("LargeFileLocation", ref val1);
object val2 = (object)_thresholdSize;
propertyBag.Write("ThresholdSize", ref val2);
#endregion
#region IComponent Member
public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
if (_largeFileLocation == null || _largeFileLocation.Length == 0)
_largeFileLocation = Path.GetTempPath();
if (_thresholdSize == null || _thresholdSize == 0)
_thresholdSize = 4096;
if (pInMsg.BodyPart.GetOriginalDataStream().Length > _thresholdSize)
Stream originalStream = pInMsg.BodyPart.GetOriginalDataStream();
string largeFilePath = _largeFileLocation + pInMsg.MessageID.ToString() + ".msg";
FileStream fs = new FileStream(largeFilePath, FileMode.Create);
// Write message to disk
byte[] buffer = new byte[1];
int bytesRead = originalStream.Read(buffer, 0, buffer.Length);
while (bytesRead != 0)
fs.Flush();
fs.Write(buffer, 0, buffer.Length);
bytesRead = originalStream.Read(buffer, 0, buffer.Length);
fs.Flush();
fs.Close();
// Create a small xml file
string xmlInfo = "<MsgInfo xmlns='http://Sample.LargeFilesDecoder'><LargeFilePath>" + largeFilePath + "</LargeFilePath></MsgInfo>";
byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(xmlInfo);
MemoryStream ms = new MemoryStream(byteArray);
pInMsg.BodyPart.Data = ms;
return pInMsg;
#endregion
I have
Added .dll file in to the Global Assembly Cache (use gacutil)
Copied it the Pipeline Components folder (E:\Program Files (x86)\Microsoft BizTalk Server 2013\Pipeline Components)
Everything was successful, when I try to add the component to the Toolbox I get the message like below and cannot find the component in Toolbox.
Tried several times but still getting stuck in the same place. I am using Visual Studio 2013. Any help is greatly appreciated.

Do not put the Assembly in the %\Pipeline Components folder.  Pipeline Component Assemblies should be in the GAC only.
To correctly deploy a custom Pipeline Component, you can follow the steps in this Wiki Article:
http://social.technet.microsoft.com/wiki/contents/articles/26404.biztalk-deploying-custom-pipeline-components-in-biztalk-server-2006-and-higher.aspx
I have never seen that specific error before.  Are you sure you're browsing from the Pipeline Components tab?

Similar Messages

  • Deploying the custom Pipeline component in Production

    I would like to know how to deploy the Pipeline component in to production. I created an an application in dev with the custom receive pipeline component in it. Thought importing the application's msi and binding file in production will automatically deploy
    the pipeline component in to Pipeline component's folder. Bad thing is I didnt check if .dll was in Pipeline component's folder and ran the application. Now the messages got suspended with error
    There was a failure executing the receive pipeline:Source: "Unknown " Receive Port: "" URI: "" Reason: Could not load file or assembly 'file:///E:\Program Files (x86)\Microsoft BizTalk Server 2013\Pipeline Components\.dll' or
    one of its dependencies. The system cannot find the file specified.
    Help me out with this. Thanks

    You do not need to copy the DLL in C:\Program Files (x86)\Microsoft BizTalk Server 2013\Pipeline Components.
    You have to just GAC the dll on all the BizTalk servers and restart the host instance.
    Please see
    BizTalk: Deploying Custom Pipeline Components in BizTalk Server 2006 and Higher wiki article
    I hope this solves all your queries.
    Greetings,HTH
    Naushad Alam
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or
    Mark As Answer
    alamnaushad.wordpress.com

  • Custom Pipeline Component stopped changing input filename

    Hi
    In my project, I have a custom pipeline component to change the input file name. I use it in the receive pipeline decode stage. It was working initially when I had only a receive pipeline and custom pipeline component in my solution. later I introduced
    two schemas, an orchestration, map and a send pipeline. The rename is not working anymore. Please help.
    receive adapter: FILE
    send adapter: FTP
    Custom pipeline component: (File Name Setter)
    Receive pipeline:
      decode: custom pipeline component to rename the filename
      disassemble: flatfile disassembler conecting to a document schema
    Map:
      Schema 1 to Schema 2 (transforms from Windows to Unix format)
    Orchestration:
      receive message
      transform using map above
      send message
      Exception Handler
    Send pipeline:
      FlatFile assembler
    manibest

    May be its not working now, because in the orchestration which you have added,
     you’re constructing a new message from the received message and the context properties from the Received message is not copied across to the newly constructed message. So when you use “%SourceFileName%” macro in the send port,
    the ReceivedFileName context property is missing in the newly constructed message which is sent out.
    So in your Orchestration, while constructing (in MessageAssignment shape) the outbound message from the Received message, copy the context property of the Received message to the newly constructed message. Something like this
    //This line copies all the context properties from received message to the outputted message
    msgOutputted (*)= msgReceived(*)
    //or
    //This line just copies the receive file name context property from received message to the outputted message
    msgOutputted (FILE.ReceivedFileName)= msgReceived (FILE.ReceivedFileName).
    If you’re not using the Orchestration or constructing the new message (even in map), then just add the schemas/orchestration or any pipeline would not affect the ReceiveFileName code. May be in this case, debug the pipeline and also check whether the outputted
    message has ReceivedFileName in its context property.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • BTDF Deployment - Custom Pipeline Component

    If I am deploying manually, I am able to deploy, GAC and get output accordingly.
    1) But when using BTDF, its not getting deployed properly and not receiving any output. What am I doing wrong ?
    2) Before deploying 'RemoveFooter' assembly and adding to PipelineBizTalk Project, how can I add that in tools of Pipeline components to add this 'RemoveFooter' component in Decode stage ?
    In BTDF mentioned this :
    <PropertyGroup>
     <IncludePipelineComponents>true</IncludePipelineComponents>
    </PropertyGroup>
    <ItemGroup>
     <PipelineComponents Include="$(ProjectName).PipelineComponents.dll">
       <LocationPath>..\PipelineComponents\bin\$(Configuration)</LocationPath>
     </PipelineComponents>
    </ItemGroup>
    MBH

    Hi
    MBH,
    The configuration that you mentioned above is totally correct. When you add the custom pipeline component in BTDF it deploys
    to “Pipeline Components” folder and at run time BTS refers the dll from this place.
    Its working for me with the same configuration and I believe it might be other problem related to the actual project.
    JB

  • Is it possible to process a 0kb file within a custom pipeline component?

    Hi There, 
    You probably wondering.. what the hell do you need this for?
    Well.. we have a third party application that process a file as following
    1) Import the original file
    2) Export the original file
    3) Append the original file (with the data I need)
    4) Create a 0 kb file with the original exported filename but added .sem to show me that the export is done.
    So my guessing was to with a custom pipeline component (receive) to pickup the .sem file, and use the original exported file to process the data from within the custom pipeline component. 
    Well, this works perfectly. 
    But... this only works if I add any data to the .sem file. 
    Otherwise BizTalk picks up the .sem file, but does not process it, it actually does not enter the pipeline at all, and it also does not appear in the tracking.
    Is there a possiblity to accept 0kb files within a custom pipeline component?
    Please help, Thanks
    DP 

    Hi,
    Here is an excellent article explaining the behavior of BizTalk for zero Byte files. It can help you achieve your mentioned goal.
    If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Custom pipeline component creates the folder name to archive messages

    Hi 
    I have an requirement that a BizTalk application is receiving untyped messages and at the receive location the pipeline have to archive the incoming message with the specifications:
    suppose I have an xml like
          <PurchaseOrder>
            <OrderId>1001</OrderId>
            <OrderSource>XYZ</OrderSource>
            <Code>O01</Code>
          </PartyType>
    In the pipeline component it has to read this xml and have to use OrderSource value 'XYZ' to create a archival folder and the message have to archive with file name '%MessageId%'
    It has to be done by writing custom pipeline component where I am not familiar with c# coding, Can anyone please how to implement mechanism.
    Thanks In Advance
    Regards
    Arun
    ArunReddy

    Hi Arun,
    Use
    BizTalk Server Pipeline Component Wizard to create a decode pipeline component for receive. Install this wizard. This shall help you to create the template project for your pipeline component stage.
    Use the following code in the Execute method of the pipeline component code. This code archives the file based with name of the file name received.
    public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
    MemoryStream tmpStream = new MemoryStream();
    try
    string strReceivedFilename = null;
    DateTime d = DateTime.Now;
    try
    //Get the file name
    strReceivedFilename = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString();
    if (strReceivedFilename.Contains("\\"))
    strReceivedFilename = strReceivedFilename.Substring(strReceivedFilename.LastIndexOf("\\") + 1, strReceivedFilename.Length - strReceivedFilename.LastIndexOf("\\") - 1);
    catch
    strReceivedFilename = System.Guid.NewGuid().ToString();
    originalStream = inmsg.BodyPart.GetOriginalDataStream();
    int readCount;
    byte[] buffer = new byte[1024];
    // Copy the entire stream into a tmpStream, so that it can be seakable.
    while ((readCount = originalStream.Read(buffer, 0, 1024)) > 0)
    tmpStream.Write(buffer, 0, readCount);
    tmpStream.Seek(0, SeekOrigin.Begin);
    //ToDo for you..
    //Access the receive message content using standard XPathReader to access values of OrderSource and construct file pathAccess the receive message content using standard XPathReader to acceess values of OrderSource and contruct the file path
    string strFilePath = //Hold the value of the file path with the value of OrderSource
    string strCurrentTime = d.ToString("HH_mm_ss.ffffff");
    strFilePath += "\\" + strReceivedFilename + "_";
    FileStream fileStream = null;
    try
    System.Threading.Thread.Sleep(1);
    fileStream = new FileStream(strFilePath + strCurrentTime + ".dat", FileMode.CreateNew);
    catch (System.IO.IOException e)
    // Handle the exception, it must be 'File already exists error'
    // Wait for 10ms, change the file name and try creating the file again
    // If the second 'file create' also fails, it must be a genuine error, it'll be thrown to BTS engine
    System.Threading.Thread.Sleep(10);
    strCurrentTime = d.ToString("HH_mm_ss.ffffff"); // get current time again
    string dtcurrentTime = DateTime.Now.ToString("yyyy-MM-ddHH_mm_ss.ffffff");
    fileStream = new FileStream(strFilePath + strCurrentTime + ".dat", FileMode.CreateNew);
    while ((readCount = tmpStream.Read(buffer, 0, 1024)) > 0)
    fileStream.Write(buffer, 0, readCount);
    if (fileStream != null)
    fileStream.Close();
    fileStream.Dispose();
    if (originalStream.CanSeek)
    originalStream.Seek(0, SeekOrigin.Begin);
    else
    ReadOnlySeekableStream seekableStream = new ReadOnlySeekableStream(originalStream);
    seekableStream.Position = 0;
    inmsg.BodyPart.Data = seekableStream;
    tmpStream.Dispose();
    catch (Exception ex)
    System.Diagnostics.EventLog.WriteEntry("Archive Pipeline Error", string.Format("MessageArchiver failed: {0}", ex.Message));
    finally
    if (tmpStream != null)
    tmpStream.Flush();
    tmpStream.Close();
    if (originalStream.CanSeek)
    originalStream.Seek(0, SeekOrigin.Begin);
    return inmsg;
    In the above code, you have do a section of code which will access the receive message content using standard XPathReader to access values of OrderSource and construct the file path. I have
    commented the place where you have to do the same. You can read the XPathReader about here..http://blogs.msdn.com/b/momalek/archive/2011/12/21/streamed-xpath-extraction-using-hidden-biztalk-class-xpathreader.aspx
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Custom Pipeline Component error

    I have created a custom pipeline component which references a template file on the local drive e.g. c:\test\template.xlsx.  however when I run the application the Send pipeline fails Reason: 'c:\test\template.xlsx' could not be found. 
    It does exist, everything is spelt correctly and the host account has access to the folder.  Why can't the component see it?
    ----------------<0>----------------
    http://redeyedmonster.co.uk
    ----------------<0>----------------

    I tried a code as highlighted by Rachit, but I don’t see issue as the referred blog suggest.
    Coming to questioners code, I created a quick pipeline component which uses a dll for
    Microsoft.Office.Interop.Excel
    accessing the excel files and does something with Excel file.
    Few things I want to highlight here.
    If the questioner (RedEyeMonster) is using the same dll (Microsoft.Office.Interop.Excel)
    in the pipeline component as I used, then I am afraid Workbooks.Open’s component doesn’t just take one parameter as shown.
    Open method doesn’t have any overloaded methods. It takes few parameter and its worth checking each one on them.Some of the parameter are very important and could cause issues (like
    ReadOnly , IgnoreReadOnlyRecommended, Editable etc). As said, the
    Workbooks .Open method doesn’t just have template file location parameter. It’s worth reviewing the code again.
    Microsoft.Office.Interop.Excel.Application excelApplication = new Microsoft.Office.Interop.Excel.Application();
    //When I tried without the following couple of lines, my program waited for long time and crashed
    excelApplication.DisplayAlerts = false;
    excelApplication.Visible = true;
    Microsoft.Office.Interop.Excel.Workbook excelWorkboook = excelApplication.Workbooks.Open(@"C:\MRAshwinPrabhu\TestExcel.xsl", 2, false,
    5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "",
    false, false, 0, false, true, 0);
    While trying the code, I create a excel file as extension *.xls (older version of Excel 97-2003 workbook) and in the code I tried to open the file as “C:\foldername\FileName.xlsx”.
    *.xls and *.xlsx are different, though in the folder the excel icon may look similar they are different file extensions. I for the same error as the questioner.
    Also issue I faced while trying this is “DisplayAlerts”
    property. When I tried without setting this property to false, my program just waited for long time and crached evently. So when you use in a program like pipeline where you don’t have UI, ensure this property is set to false.
    Hope the above suggest would help the questioner.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Custom Pipeline Component - Deployment Issue

    We have created a custom pipeline component that logs information via ETW. The component was added to a suite of common pipelines that our applications share, as well as to a handful of application specific pipelines that require other custom components
    used only by those applications. I made a change to the component and deployed the DLL to our test environment, added it to the GAC and restarted all of the host instances. The common pipelines all seem to work fine with the new DLL, but for some reason those
    pipelines that are application specific (which use the same version of the DLL) all started generating the "Object reference not set to an instance of the object" error. So I replaced the new DLL with the original version and all of the pipelines
    (common and otherwise) worked okay again. Can anyone tell me what I need to do to get the application specific pipelines to work with the modified DLL?
    Thank you.
    Thanks, Bruce

    Quite certain. The application specific pipelines call public methods that write string data to a log file - they don't pass any parameters - all of that is contained within the component itself. We only changed the content of the data for the internal parameters,
    not the data type, so the signature of the procedures remain the same.
    The original author of the code had the component logging every attribute of the pipeline and received message to the log file which was creating very large and non-useful logs. We only replaced the call to the pc.GetProperties() and inmsg.GetProperties()
    methods (both return string values) with concise strings containing the data we need logged.
    The first version of the pipeline did not contain the GetProperties methods, those were added later and the pipeline was deployed for testing. At that time, all of the application specific pipelines began generating errors that the GetProperties() method
    was not recognized, so we ended up having to go back and rebuild and re-deploy all of the application specific pipelines to use the newer version in order to get them to work. We should not have to go through this much effort to replace a shared
    library, and am hoping we can find a way to deploy it without having to redeploy all of the other pipelines as well.
    We deployed the new pipeline according to Microsoft's recommendations in
     BizTalk: Deploying Custom Pipeline Components in BizTalk Server 2006 and Higher so we are left scratching our heads at this point.
    Thanks, Bruce

  • Pipeline component for replace the values in send pipeline 837P

    hi friends,
    I am working in 837P splitting the claims.When i am sending using sendpipe line.
    I need  pass the 2010bb loop NM103 and NM109 defaluts values,
    ex: NM103=100,NM109=0123456789
    like can you help me write pipeline component to manipulate the XPath and replace the default values.
    THanks
    hk

    you will need to extract data from the message coming on your receive location.
    You can create two diffferent function which can do your task.
    The first one is to get the stream from the message and create a seekable one to be used later on.
    private Stream GetMessageStream(Microsoft.BizTalk.Message.Interop.IBaseMessage msg, Microsoft.BizTalk.Component.Interop.IPipelineContext context)
       Stream stream = msg.BodyPart.GetOriginalDataStream();
        if (!stream.CanSeek)
            ReadOnlySeekableStream readStream = new ReadOnlySeekableStream(stream);
            if (context != null)
                context.ResourceTracker.AddResource(readStream);
            msg.BodyPart.Data = readStream;
            stream = readStream;
        return stream;
    The second method is the one that would perform the data extraction as follows.
    private string ExtractDataValueXPath(Stream MsgStream, string MsgXPath)
        XmlReaderSettings settings = new XmlReaderSettings()
          ConformanceLevel = ConformanceLevel.Document,
            IgnoreWhitespace = true,
            ValidationType = ValidationType.None,
            IgnoreProcessingInstructions = true,
            IgnoreComments = true,
            CloseInput = false
        MsgStream.Seek(0, SeekOrigin.Begin);
        XmlReader reader = XmlReader.Create(MsgStream, settings);
        string strValue = null;
        if (!string.IsNullOrEmpty(MsgXPath))
            if (reader.Read())
                XPathDocument xPathDoc = new XPathDocument(reader);
                XPathNavigator xNavigator = xPathDoc.CreateNavigator();
                XPathNodeIterator xNodes = xNavigator.Select(MsgXPath);
                if (xNodes.Count != 0 && xNodes.MoveNext())
                    strValue = xNodes.Current.Value;
                MsgStream.Seek(0, SeekOrigin.Begin);
        return strValue;
    You can update the node with the Xpath of the element.
    Thanks
    Abhishek

  • After changing laptops, i am unable to add songs into my iPhone 4. The song appears in the library but not in the device. Help!

    I have not been able to add songs into my iPhone after switching computers. The mp3 format of these current songs are in the old laptop and i am unabe to retrieve them. In the new laptop, i am unable to add songs to my device, only to the iTunes library.

    Best route here is to focus initially solely on the iTunes Library.  Once it has all the Songs that you want, turn off iTunes Match, sign out of iTunes Store and restart the computer from cold.
    Moving to the iPhone would suggest a restore and fresh link to the library post the following steps.
    1.  Sign in to iTunes Store;
    2.  Turn on iTunes Match - allow 3-step process to run to completion;
    3.  Make secure backup of library;
    4.  Force iPhone in to restore mode - hold down 'power on/off' with 'home key' for 10 seconds
    5.  Attach iPhone via USB to computer and follow 'restore' instructions in iTunes
    6.  Once complete synchronise with library as required
    At this stage all required Songs should be on the iPhone - post iPhone back-up a good point to fully enable iTunes Match on the iPhone if required.

  • Custom Pipeline Component in BTDF

    I have created a separate c# based custom pipeline component, how should I embed this in BTDF ?
    Want to make sure this is Gac'd and available when I deploy to all other environments ?
    MBH

    I created a c# code Custom Pipeline component for parsing against my flat file schema.
    <PropertyGroup>
     <IncludePipelineComponents>true</IncludePipelineComponents>
     </PropertyGroup>
    <ItemGroup>
     <PipelineComponents Include="$(ProjectName).PipelineComponents.dll">
       <LocationPath>..\PipelineComponents\bin\$(Configuration)</LocationPath>
     </PipelineComponents>
    </ItemGroup>
    But it doesn't appear when I deploy into other environments ? what am I  missing  ?
    MBH

  • Show the custom popup window on clicking the people name in sharepoint people search result

    Show the custom popup window on clicking the people name in sharepoint people search result
    We are doing the below code to open a popup but while clicking on name link its postback the page and not opening the popup in first click but opening in second click.The same issue occurs while navigate to second page using pagination
    The below code used to show name in item template
    <button id="NameFieldLink" class="temp" style="font-size: 12px;text-decoration:none;color:#0072c6;border:0px solid #fff;background:transparent;margin-left: 1px;height: 15px;padding: 0 10px 17px 0px;text-align: left;cursor:pointer;font-family:
    Arial, Helvetica, sans-serif;" title="">_#= DisName =#_</button> 
    The below jquery code used to open popup in control search template
    ctx.OnPostRender = []; 
    ctx.OnPostRender.push(function () {
    $(".temp").on("click", function(event)
    event.preventDefault();
    $('#fadeout').show();
    $('#pop1').find('.tab-content-people').html($(this).closest('.emp-card').find('.pop-content').html());
    $('#pop1').show();
    return false;

    I believe the issue is that you are not actually searching against the result source you made in step #1.
    It's not enough to make a result source, you have to tell the search results web part to use it.
    Try this:
    1. Go to the Pages library of Search Center
    2. Create a new Search Results page
    3. Edit the page, then edit the search results web part
    4. Change the source for the search results web part to your source
    5. Add the page to your Search Center navigation
    6. Run the search on that page
    Scot
    Author,
    Microsoft SharePoint 2013 App Development
    Author,
    Professional Business Connectivity Services
    Author,
    Inside SharePoint 2013
    Blog, www.shillier.com
    Twitter, @ScotHillier
    SharePoint Trainer, Critical Path Training

  • Set the custom timer job that copy the data in the same list

    Hi
    How to set the custom timer job that copy the data in the same list
    Thanks,

    hello
    please it is wrong to copy all of the list3 item in list1 as the example as below is a copy of one item.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint;
    //This namespace is used for the SPJobDefinition class
    using Microsoft.SharePoint.Administration;
    namespace GENERAL_CustomTimerJob
    //To create a custom timer job, first add a class to your SharePoint project and
    //inherit from SPJobDefinition. Implement the constructors and override the Execute
    //method as shown below. To install your timer job, and set the schedule, you must
    //add a Feature and a Feature receiver.
    class GENERAL_CustomTimerJob :
    SPJobDefinition
    #region Constructors
    //You must implement all three constructors
    public GENERAL_CustomTimerJob()
    base()
    public GENERAL_CustomTimerJob(string jobName,
    SPService service,
    SPServer server, SPJobLockType targetType)
    base(jobName, service, server, targetType)
    public GENERAL_CustomTimerJob(string jobName,
    SPWebApplication webApplication)
    base(jobName, webApplication,
    null, SPJobLockType.ContentDatabase)
    //Set the title of the job, which will be shown in the Central Admin UI
    this.Title = "Simple Example Timer Job";
    #endregion
    //Override the Execute method to run code.
    public override
    void Execute(Guid targetInstanceId)
    //Get the Web Application in which this Timer Job runs
    SPWebApplication webApp =
    this.Parent as
    SPWebApplication;
    //Get the site collection
    SPSiteCollection timerSiteCollection = webApp.ContentDatabases[targetInstanceId].Sites;
    //Get the Announcements list in the RootWeb of each SPSite
    SPList timerJobList =
    null;
    foreach (SPSite site
    in timerSiteCollection)
                    timerJobList = site.RootWeb.Lists.TryGetList("List3");
    if (timerJobList != null)
    string sourceUrl = "http://aydi-pc";
    string destinationUrl =
    "http://aydi-pc/sites/Site1/";
    string sourceList = "List3";
    string destinationList =
    "List1";
    using (SPSite sourceSite =
    new SPSite(sourceUrl))
    using (SPWeb sourceWeb = sourceSite.OpenWeb())
    using (SPSite destSite =
    new SPSite(destinationUrl))
                                    using
    (SPWeb destWeb = destSite.OpenWeb())
    SPList ObjSourcelist = sourceWeb.Lists.TryGetList(sourceList);
    SPList ObjDestinationlist = destWeb.Lists.TryGetList(destinationList);
    SPListItem newItem = ObjDestinationlist.Items.Add();
    SPListItemCollection items = ObjSourcelist.Items;
                                        if
    (items.Count > 0)
    foreach (SPListItem item
    in items)
    newItem["Title"] = item["Title"];
    newItem["Nom"] = item["Nom"];
    newItem["Prenom"] = item["Prenom"];
    newItem.Update();

  • How to download the custom Tables to xls from the system?

    Hi
    How to download the custom Tables to xls from the system?
    Vijay

    Hi,
    Goto SE11, in the table name field give Z*, and click on display. You will get the list of Z tables.
    Regards,
    Prabu

  • How to download the custom Reports to xls from the system?

    Hi
    How to download the custom Reports to xls from the system?
    I know the t code SE38 for reports.
    Vijay

    Hi
    Here the programa name is nothing but a report name???
    Vijay

Maybe you are looking for

  • Training and Event module questions.

    Hi . I have some questions regarding Training and Event Management module. 1. IS there a way to configure a custom attendee type for this module ? 2. If no is there a way to rename a existing attendee type. I have a requirement to create a group of a

  • WRT150N Drops connection

    I have a WRT150N that worked great when I got it, but now it won't  stay connected. I have a computer that is wired into the router and works fine. But the wireless keeps on dropping.  I have had this issues for a while now and it's beginning to be a

  • Faxing

    Previous post in ... http://discussions.apple.com/thread.jspa?threadID=931792&tstart=0 Does OS X 10.4 have a bult in fax component. The reason why I ask is there seems to be but it doesn't seem to work. There seems to an address book but no way of ac

  • Where to find ipad air access key

    I was going to download Polaris Office and it asks for the Access Key.  Where do I get the Access Key?

  • PS CS4 Scratch Disk Ownership on this Volume Problems

    I have a second hard drive selected as a scratch disk for Photoshop CS4 but PS won't start unless a check is put in the box "Ignore ownership on this volume". However that won't stay checked and I keep having to go into "Get Info" and rechecking that