Ejemplo n.º 1
0
		/// <summary>
		/// Gets the DTS package version info.
		/// </summary>
		/// <param name="serverName">Name of the server.</param>
		/// <param name="packageName">Name of the package.</param>
		/// <param name="userName">Name of the user.</param>
		/// <param name="passWord">The pass word.</param>
		/// <param name="Auth">The auth.</param>
		/// <param name="LatestPackage">if set to <c>true</c> [latest package].</param>
		/// <returns>Returns version information as a string.</returns>
		public string GetPackageVersionInfo(string serverName, string packageName, string userName, string passWord, authTypeFlags Auth, bool LatestPackage)
		{
			int verMajor;
			int verMinor;
			int verBuild;
			string verComments = null;
			string retval = null;

			oPackage.GetDTSVersionInfo(out verMajor, out verMinor, out verBuild, out verComments);
			retval = "SQL Version information: " + verMajor.ToString() + "." + verMinor.ToString() + "." + verBuild.ToString() + "\n";
			DTS.Application app = new DTS.ApplicationClass();
			DTS.PackageSQLServer pss = app.GetPackageSQLServer(serverName, userName, passWord, ConvertFromAuthTypeFlag(Auth));
			foreach(DTS.PackageInfo pi in pss.EnumPackageInfos("", LatestPackage, ""))
			{
				if (packageName == pi.Name)
				{
					retval = retval + "\nPackageName: " + pi.Name;
					retval = retval + "\nPackageID: " + pi.PackageID;
					retval = retval + "\nVersionID: " + pi.VersionID;
					retval = retval + "\nOwner: " + pi.Owner;
					retval = retval + "\nDescription: " + pi.Description;
					retval = retval + "\nCreation Date: " + pi.CreationDate;
					retval = retval + "\nPackage Data Size: " + pi.PackageDataSize.ToString();
					retval = retval + "\n\n";
				}
			}
			return retval;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Converts from auth type flag to DTS SQL server storage type flag.
		/// </summary>
		/// <param name="Value">The auth type flag value.</param>
		/// <returns>Returns DTS SQL server storage type flag.</returns>
		private DTS.DTSSQLServerStorageFlags ConvertFromAuthTypeFlag(authTypeFlags Value)
		{
			if (Value == authTypeFlags.Default)
				return DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default;
			else
				return DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection;
		}