I have a package that loads CSV files from a folder, I have setup a foreach file enumarator to loop through the directory and assigns the files that starts with "Example*.csv" including the extention.
The package runs fine in SSDT but once i deploy and run it through the agent job does not load anything and the jobs runs successfully. I have removed the Foreach loop and connected the Flat file connector to one file and it works perfectly .
Please assist I am new to this.
Expression passsed to Flat File connection manager :
FolderLocation = "\Sharedrive\Business\Company-info
Related
I'm trying to get the direct path of my local database.
I put the database inside my main project folder:
Then I used this code to get the path:
Dim cn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=" + My.Application.Info.DirectoryPath + "\database\database.mdf;Integrated Security=True;User Instance=True")
Everything is OK now.
So why is the database copied into the \bin\Debug folder?
Then if I open the source code and run the project and try to save data or find data that I saved before from the application in \bin\Debug I don't find it? Why?
What I mean
If I run the project from \bin\Debug its will save
If I run the project from project1 folder from (.sln) and try to show the data table I don't find may saved data.
The opposite is true
Here's how it works. You add a data file to your project and it is a source file. You build your schema in that file and you also add any default data to that file. You don't use that file for testing and debugging though. How would it make sense to pollute that file with test data and then you've got no clean database to deploy with your application when you release it?
When you build, that source file gets copied to the output folder. If you build a Debug version, the data file gets copied to the Debug folder and that's where you mess it up with your test data. When your application is ready to deploy, you switch to a Release build and a nice clean copy of your source database is created in the Release folder.
By default, the Copy to Output Directory property of that source file is set to Copy Always. That means that any time you run your project and there are changes to any source file, a new copy will overwrite the one already in the Debug folder and any changes you made last time you debugged will be lost. If you change that property to Copy if Newer, a new copy will only be made if you change source data file. That allows you to keep changes between debugging runs. To force a refresh, just do a Clean or delete the copy manually.
In SSIS I am using a Foreach loop container to loop through a list of files.
My project works fine in locally - it finds the files, but when I deploy to SSMS and run it, it gives the error:
The for each file enumerator is empty. The for each file enumerator did not find any files that match the pattern, or specified directory was empty.
The directory I am pointing to is a network location
I have permissions on this directory.
Has anyone experience this issue before?
I am using an SSIS package for which i have created an XML configuration file.
But when I tried to run the package using the Execute Package Utility, and added a new XML Configuration file, it's taking the connection from in-built connection manager.
I am not being able to connect to any other Config file, until I configure that file by opening my solution.
How can I add some other configuration file while running from Execute Package Utility, without configuring it from the solution?
I have a problem that has been bugging me.
I have a Visual studio 2013 solution that goes through Release management.
One of the release steps in Release management is running a simple batch file using the Actions -> SxSBatchCommand tool. This is a custom action that simply executes a batch file and the batch file executes a simple rename that goes like this:
rename "$(currentDir)\project.ev1.app.config" "project.exe.config"
Which basically takes a specific app.config and applies it in the deployed directory as the main config.
All this works well but because I don't like all the batch files in my project, I decided to delete them and to use the WindowsOS -> Rename File or folder tool
So I deleted the SxSBatchCommand and added the "Rename File or Folder" with parameters:
FileFolderName: project.ev1.app.config
DestinationName: project.exe.config
I also tried:
FileFolderName: $(currentDir)\project.ev1.app.config
DestinationName: project.exe.config
This failed during deployment with the message:
The following command failed with the exit code '1' : powershell -command ./ManageWindowsIO.ps1 -Action Rename -FileFolderName 'project.ev1.app.config' -DestinationName 'project.exe.config'
Any ideas why such a simple command wouldn't be working?
Thanks
Can you run this exact command in powershell console ? You can also click on the button next to the command in the release log to grab a better detaild log whith explanation what went wrong .
The file could be in use , or without proper permissions for modification , you can look for the agent's logs in the target machine .
By the way if you are trying to make a file changed to the name of a configuration file for a win service or want to use transformation in a non web application you can use slow cheetah to accomplish it .
I did a get latest from TFS.
My local path is:
C:\tfs\Project\Branch1\Config\Deployment\CopyInstallers.bat
TFS Path is:
$\Project\Branch1\Config\Deployment\CopyInstallers.bat
CopyInstallers.bat gets latest of installer folder from the branch at different location on the server and zips them and puts it on the shared location on server.
I have another branch named Branch2 and its TFS path is
$\Project\Branch2\Config\Deployment\CopyInstallers.bat
What I am trying is try to get the branch name using TF.exe or TFPT.exe, so that I should not har code the branch name in the CopyInstaller.bat file to get latest of installer folder.
Or is there any other way by which I can get to know the branch name / path with in the batch file?
Use the TF.EXE info command.
From the DOS Shell go to the directory in your workspace where the branch is located (C:\tfs\Project\Branch1\Config\Deployment)
Use the command : TF.EXE info .
Parse the result on the "Server Path:" line.
EDIT :
With Visual Studio 2010 replace the info command by the properties one
EDIT 2
Ok: I made you a console app, get the zip file here, there's the sources code and build exe.
Tell me if it's what you expected