WHY? Would you use VB for FTP in SSIS?

Could someone explain what is going on here, this is from the Get List of files Script Task
Public Sub Main()
        Dim saAllFileNames As Collection = New Collection()
        Dim b2222Success As Boolean
        Dim b111Success As Boolean
        ' Get 2222 files
        b2222Success = GetFileList(Dts.Connections("Company FTP"), CStr(Dts.Variables("2222_Path").Value), saAllFileNames)
        ' Get 111 files
        b111Success = GetFileList(Dts.Connections("Company FTP"), CStr(Dts.Variables("111_Path").Value), saAllFileNames)
        Dts.Variables("FTPFileList").Value = CObj(saAllFileNames)
        If b2222Success AndAlso b111Success Then
            Dts.TaskResult = ScriptResults.Success
        Else
            Dts.TaskResult = ScriptResults.Failure
        End If
    End Sub
    Protected Function GetFileList(ByRef conn As ConnectionManager, ByVal sPath As String, ByRef saAllFileNames As Collection) As Boolean
        Dim saFolderNames As String() = Nothing
        Dim saFileNames As String() = Nothing
        Dim ftp As FtpClientConnection = New FtpClientConnection(conn.AcquireConnection(Nothing))
        Dim bSuccess As Boolean
        Try
            If ftp.Connect() Then
                ftp.SetWorkingDirectory(sPath)
                ftp.GetListing(saFolderNames, saFileNames)
                If Not saFileNames Is Nothing Then
                    For Each sCurFileName As String In saFileNames
                        saAllFileNames.Add(sPath & sCurFileName)
                    Next
                End If
                Dts.Variables("FTPFileList").Value = CObj(saAllFileNames)
            End If
            bSuccess = True
        Catch ex As Exception
            bSuccess = False
            Call Dts.Events.FireError(0, String.Empty, ex.Message, String.Empty, 0)
        Finally
            ftp.Close()
        End Try
        Return bSuccess
    End Function
End Class

It gets a list of filesnames and puts them in an object variable. There is probably an foreach loop container with an ADO.NET enumerator after the script task to loop through all files...
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter

Similar Messages

  • Why would you use a managed service account rather than a virtual account in SQL Server 2012?

    In SQL Server 2012, service accounts are created as
    virtual accounts (VAs), as described
    here, as opposed to
    managed service accounts (MSAs).
    The important differences I can see for these, based on the descriptions:
    MSAs are domain accounts, VAs are local accounts
    MSAs use automagic password management handled by AD, VAs have no passwords
    in a Kerberos context, MSAs register SPNs automatically, VAs do not
    Are there any other differences? If Kerberos is not in use, why would a DBA ever prefer an MSA?
    UPDATE:
    Another user has noted a
    possible contradiction in the MS docs concerning VAs:
    The virtual account is auto-managed, and the virtual account can access the network
    in a domain environment.
    versus
    Virtual accounts cannot be authenticated to a remote location. All virtual accounts
    use the permission of machine account. Provision the machine account in the format
    <domain_name>\<computer_name>$.
    What is the "machine account"? How/when/why does it get "provisioned"? What is the difference between "accessing the network in a domain environment" and "authenticating to a remote location [in a domain environment]"?

    Hi,
    “Virtual accounts cannot be authenticated to a remote location. All virtual accounts use the permission of machine account. Provision the machine account in the format <domain_name>\<computer_name>$.”
    “The virtual account is auto-managed, and the virtual account can access the network in a domain environment. If the default value is used for the service accounts during SQL Server setup on Windows Server 2008 R2 or Windows 7, a virtual account
    using the instance name as the service name is used, in the format NT SERVICE\<SERVICENAME>”
    Per the above description, they are two concepts and not conflict with each other.
    As you understand, virtual account access network resources by using the credentials of the computer account. Generally, computer account will not be granted permission unless giving the computer account permission on the shared folder manually.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Why would you use Java over C/C++

    This thread :
    http://forum.java.sun.com/thread.jspa?threadID=689490
    Brought back to mind a problem I had in the first C program I worked on -
    I'd declared an array and a file pointer on the stack in a function, overwrote the end of the array by mistake, and trashed the file pointer. The file pointer was used a while after the array was overwritten - took me 2 days to work out what was happening. Array overwrites like this are just not possible in Java - that's a reason to use Java over C or C++.
    Anyone else got their own scare stories like this ? Maybe someone's got a Java scare story that would make you use C ?

    A C++ based bond trading system had the description database varchar field width of 60 characters. The GUI software to display this had buffers 60 characters wide. New bonds came along with widths of over 60 characters so the database field width was changed to 80 characters but nobody told us (the GUI maintenance team) about the change.
    There was no real problem for about 4 days after the first long named bond was inserted. Then, at random times, the GUI application would crash. It took many many days to find the source of the problem and to fix it. The blame was laid at the door of the GUI maintenance team even though we had not written the code and we had logged the potential problem in the bug database months before but management decided that it was not a problem so should not be 'fixed'.
    This literally cost millions because the traders could not be sure of their positions.
    I left as soon as my contract ran out.

  • Why would you use JavaFX over JavaEE or JavaSE?

    Just curious why you would use FX over the others? Is it because of the GUI, and some added features, or what makes FX better?
    Also what exactly is the differences between the 3? It seems like SE is the basic, then EE is used for client-server and maybe security and such? FX seems to just have advanced GUI and stuff like that? Does anyone have a link or a list of what features are different and such?
    Thanks a lot!!!
    ~KZ
    Edited by: KonradZuse on Jul 6, 2012 8:41 AM

    KonradZuse wrote:
    I usually use swing, but I am starting a new business application for real world use, so I want it to be the best it can be. FX's Gui is great, but is it worth it to start using that right away? I also want to be able to use 3D, and as someone said you can do 2D in a 3D space, so that is basically what I need for now, but I would like to be able to do full 3D.JFX isn't exactly built to do 3D stuff right now. But neither is Java2D (the base for AWT and Swing), so nothing is different really.
    So what I really want to know is what is the differences between SE and EE?One is "Java", the other is a specification. For more information I refer to Google.

  • Why would you use Group Discovery

    Does Group discovery just get members (systems or users) from groups? If so, I can just do that on the actual system discovery or user discovery, there is a check box to discovery members of a group. So my question is, what is the point?

    So the actual groups would be in the CM console? At that point I can create a collection of a group or groups and deploy to the machines in those groups? 
    The groups themselves would not be in the console but you would be able to deploy to members of a group by building a collection with query based memberships.
    Query would look like this:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,
    SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client
    from SMS_R_System where SMS_R_System.SystemGroupName = “DomainName\\GroupName”
    Collection will contain all systems member of the group.

  • What command would you use to check for allocation, structural, or logical integrity problems?

    What command would you use to check for allocation, structural, or logical integrity problems?

    Wondering if you are looking for DBCC CHECKDB command? For more information, on that command, try to look at this:
    http://technet.microsoft.com/en-us/library/ms176064.aspx

  • You want to know the amount of space the transaction log for the Customer database is using. Which T-SQL command would you use?

    You want to know the amount of space the transaction log for the Customer database is using. Which T-SQL command would you use?

    Forced me to do a little research.
    DBCC SQLPERF(logspace)
    See also
    http://stackoverflow.com/questions/198343/how-can-i-get-the-size-of-the-transaction-log-in-sql-2005-programmatically
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • What camera raw default settings would you use for the Canon 5D Mark 3. I have PS CS6.  Thank you.

    What camera raw default settings would you use for the Canon 5D Mark 3. I have PS CS6.  Thank you.

    Really, this is a question you should be asking yourself...
    What do you shoot? Makes a difference...
    Typical ISO that you shoot? Makes a difference...
    Shooting for clients or yourself? Makes a difference...
    Look, there is no magic bullet...the ACR/LR "Default" should only be changed for those adjustments you make 70-90% of the time and sould not be confused with image by image adjustments...
    So, as asked, your question can not really be answered other than to say, use a default that suits you.

  • Why would you allow firefox to update computer web-browsers if you have an idea that it will no longer work after the update? And why would you not include instructions for, how to fix the problem? Help Please! Can I go back to the old one?

    Why would you allow firefox to update computer web-browsers if you have an idea that it will no longer work after the update? And why would you not include instructions for, how to fix the problem? Help Please! Can I go back to the old one?
    Ron Bell
    [email protected]

    Mozilla, like many other software companies, thoroughly test their software before releasing it to the public and I'm sure that no problem you are having is intentional.
    I do not work for Mozilla but I do have experience of releasing software for public usage.
    Firefox has no way of knowing what other software is already on your computer and with millions of combinations it isn't always possible to test for every scenario.
    You can go back to the old version of Firefox but that won't always solve your problem.
    The web site below tells you how:
    https://support.mozilla.com/en-US/kb/Installing%20a%20previous%20version%20of%20Firefox

  • Why would you charge me $40 for a supposedly free upgrade?Have been a faithful verizon customer for years went in for myfree upgrade and paid for a iphone and protectve cover now I have to pay a fee for a free service? I will start switching my devices to

    Why would you charge me$40 for a free upgrade? I chose a iPhone and paid you the difference plus protective cover, now you want to charge  me a fee for activating a number I have had for years!!!  I have been a faithful Verizon customer for years but I will switch companies when my contracts are up or I can get a buy out from another company, your free upgrade is not free and is a false advertisement as far as I'm concerned

    However you had already stated you did not choose a "free upgrade", but paid the difference for an iPhone. So much for your "free upgrade". Additionally, I was not aware Verizon was in the business of giving away "free service"(s)?????? Purchasing a "free" or "reduced price" phone IS NOT a free service. You sign a contract in exchange for receiving that benefit. There is an upgrade fee along with that service you are contracted to complete or you will be charged an early termination fee(ETF), so this IS NOT a free service.
    Yes, you have a choice to go with another provider which ALSO charges an upgrade fee OR charges you full retail value for your phone. So much for a "free upgrade" there.
    AT&T = upgrade fee
    Sprint = upgrade fee
    T-Mobile = no upgrade fee but must pay full retail cost for the phone
    For what it is worth, you would not have had to pay an upgrade fee had you simply paid full retail cost for your phone OR purchased it with Edge at full retail cost. Depending on your calling plan and data allowance, you may have even ended up paying less for your phone had you done so. That is why a little research before you make a purchase can go a long way.
    I know it is cheaper for me to pay full retail for a phone than to purchase a discounted device in exchange for signing a contract.
    Good luck with the new provider.

  • Why would you add Paths to a jpeg?

    Hi Everyone!
    I've been using Ps on and of for a few years now as a hobby so I'm somewhat able to find my way around it.
    Now for the actual question:
    Why would you add Paths to a jpeg?
    Moreover why split it into several paths? I have a vague memory of paths beeing able to render for example a background transparent in say illustrator. Can that be it?
    My reason for asking is that I work as a Digitalprinter operator and we have got a client that wants us to mask out objects in pictures and also in som cases separate them into paths.
    I've scaled down the example we got from the client and added a link to it below hopfully someone can open this in Ps and explain why you would do this.
    Dropbox - Paths
    Thank you for your time.

    Probably shouldn't reply using my cellphone while working, I'm doomed to get it out wrong.
    What I ment is that I can't see for example how Path 3 as shown below in white (using quick mask) would be useful in a page layout program. Because the text that you create in that program would flow around "everywhere". Or am I wrong in believing this?

  • Why would you NOT enable Loop Guard on switch ports?

    Hello
    Why would you NOT enable Loop Guard on switch ports?
    It is disabled by default on all ports.
    Since it prevents loops, in the absence of receiving BPDUs on non-designated ports, why would it not be enabled by default?

    Ziffy wrote:
    The Galaxy S4 supports Google Wallet, but yet you block it from being used. Why exactly? This is not right. I suggest you enable it before you start losing customers. Is there anybody out there that would like to start a petition? Perhaps look into whether or not this is actually legal? Seems like unfair practices to me. Thoughts?
    Good luck with that.  FCC already did and have left it alone...  My theory is because... Google charges carriers to use allow devices to use it.  At one point Sprint paid to go exclusive for wallet.  FCC can't force you to buy your competitors product.

  • Why would you think java is a better beginner language then c/c++ ???.

    Why would you think java is a better beginner language then c/c++.That is if you think it is

    1.)because it stear's you towards useing oop style programing.
    since nearly everything relate's to object oriented programing.
    2.)this forum alone. is a reason thier are comprehensive example's for beginers. and so many people many very freindly and dont mind answering a question. Other beginners are here also who share what they know with each other.
    3.)learing curve for useing the language and geting started immediately is good.
    4.)once you learn java and then goto c++ you have another probably better perspective on how to code.
    5.)codeing in java avoids deconstructors pointers and direct manipulation of reference's. which can be very confuseing for beginers
    and deals with variables that directly point to the computer's memory.
    and proper deallocation of memory.
    though im just a begginer myself i started trying c++ and switched to java.
    however thier are somethings in java that can be as complex as c++
    when pointers or reference's are needed but not available.

  • Why would you disable one processor?

    just curious about the system preferences pane that lets you specify whether to use one processor core or two. why would you set it to one? what practicle application could there be to disable a processor core?

    Developers may need to disable a processor as part of software development. Disabling a processor on a laptop will extend battery life when processing speed isn't critical. May be necessary to determine if one of the processors is defective.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Why do we use dunning for vendors

    Hi All...
    We create dunning for customer to send them reminders for payment....But why do we use dunning for vendors (in Vendor Master Data)??
    Txk,
    Umesh

    Hi,
    If you dun customers who are also vendors and want to clear the items, the dunning program lists both the overdue customer items and the overdue vendor items in the dunning proposal, and determines a joint balance.When you dun a customer who is also a vendor, only the master record information of the customer is relevant.The items can only be cleared if the same dunning procedure has been defined in the standard dunning area for both customer and vendor.
    Hope this helps you. let me know if you need anyother information.
    Rgds
    Manish
    ===========================================================================

Maybe you are looking for

  • Action Links vs. HTML Links - Can you make both open in a new window?

    We are creating some reports that and are trying our best to keep them short and to the point. My requirement is that I pull a list of top accounts based on prior year revenue values. That piece is covered. Now that I'm trying to make sure the sales

  • Please tell me the error in the query

    select last_name,hire_date, trunc(months_between(sysdate,hire_date)/12) years, trunc (months_between(sysdate,hire_date)/60) "years divided by 5" CASE trunc(months_between(sysdate,hire_date)/60) WHEN 0 then 'intern' WHEN 1 then 'junior' WHEN 2 then 'i

  • Sending email notifications in oim 11g approval flow dynamically

    Hi, I have 4 level approval workflow in oim 11g and developed custom composite to get all the approver ids and and assigning these ids into 4 variables. And used these variables in my custom 4 level sequential workflow. This workflow is working fine.

  • Oracle 10G reports?

    Dear all, I have complex reports that is written in Oracle Reports Builder and basically has the JSP extension. My question is can this be used directly in Apex or do I need to do any conversion before it can be used in Apex?. Thanks. Regards, Kueh.

  • Fault handling using BPEL

    Good, I'm working on a research project and I have been assigned the task of processing errors in SOAP BPEL. I've been searching on Internet and the most commonly methodology used is soap-fault with throwing and catching exceptions in BPEL process. I