Good Morning! Another 5 inches fell last night. I gave up on the snow blower because the snow was relatively light. We are suppose to get nailed on Thursday, Sunday and Tuesday. I’d say our chances of a green Christmas this year are pretty good. My Dominican trip can’t get here fast enough.
Today’s topic is using a DTS package for SQL 2000 in your vb.net application without requiring a specific filename or path from your users. Yes, SQL 2000 is old but a lot of us still have to use it. Hope you find it useful and make it a great day!
‘ Copy the file that the user wishes to import into the required location
Dim STR_file1 As String
If OFD_import.ShowDialog() = DialogResult.OK Then
Dim STR_FilePathAndName As String = OFD_import.FileName
STR_file1 = "C:\Import\Import.txt"
‘ Remove the file from the import folder – this file cannot exist a new one is copied over
If System.IO.File.Exists(STR_file1) = True Then
‘ Copy the file to the import folder
If System.IO.File.Exists(STR_FilePathAndName) = True Then
‘ Run the DTS package
Dim oPackage As DTS.Package = New DTS.Package()
PackageName:="Part Manager Import")
oPackage = Nothing
Technorati Tags: vb.net,.NET Framework,csharp,SQL 2000,DTS,Package,path,Copy,user,location,OFD_import,DialogResult,FileName,Remove,folder,System,File,Delete,LoadFromSQLServer,Flags,DTSSQLServerStorageFlags,DTSSQLStgFlag_UseTrustedConnection,PackageName,Manager,Execute,UnInitialize,users