J
J-T
I have a class like below I have a couple of questions about that:
1) I like to use "Using statement" when creating an object of this class,so
I had to implement IDisposable.Am I doing this right here?
2) Do I have to be worried about those objects I have created in
GetPackageNames() ?? for instance making them null afterward or something?
3) This class is in my business layer As you can see I'm using
Microsoft.SQLServer.DTSPkg80 namespace and in my only methodI am returning
an object of Type "PackageInfos".This means that in my presenation layer I
need to have this name space to otherwise the output object of this method
won;t be recognized. Is it a right thing to do? or I should change something
in my Code?
I so appreciate youe help.
Thanks
using System;
using Microsoft.SQLServer.DTSPkg80;
namespace AIMS.Business.ClassFiles.DTS
{
public class DTSIntrop : IDisposable
{
protected string databaseServer;
public DTSIntrop(string databaseServer)
{
this.databaseServer=databaseServer;
}
public PackageInfos GetPackageNames()
{
ApplicationClass application = new ApplicationClass();
PackageSQLServer pkgSQLServer =
application.GetPackageSQLServer(this.databaseServer,"","",DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection);
PackageInfos pkgInfos = pkgSQLServer.EnumPackageInfos("", false, "");
return pkgInfos;
}
#region IDisposable Members
public void Dispose()
{
this.Dispose();
}
#endregion
}
}
1) I like to use "Using statement" when creating an object of this class,so
I had to implement IDisposable.Am I doing this right here?
2) Do I have to be worried about those objects I have created in
GetPackageNames() ?? for instance making them null afterward or something?
3) This class is in my business layer As you can see I'm using
Microsoft.SQLServer.DTSPkg80 namespace and in my only methodI am returning
an object of Type "PackageInfos".This means that in my presenation layer I
need to have this name space to otherwise the output object of this method
won;t be recognized. Is it a right thing to do? or I should change something
in my Code?
I so appreciate youe help.
Thanks
using System;
using Microsoft.SQLServer.DTSPkg80;
namespace AIMS.Business.ClassFiles.DTS
{
public class DTSIntrop : IDisposable
{
protected string databaseServer;
public DTSIntrop(string databaseServer)
{
this.databaseServer=databaseServer;
}
public PackageInfos GetPackageNames()
{
ApplicationClass application = new ApplicationClass();
PackageSQLServer pkgSQLServer =
application.GetPackageSQLServer(this.databaseServer,"","",DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection);
PackageInfos pkgInfos = pkgSQLServer.EnumPackageInfos("", false, "");
return pkgInfos;
}
#region IDisposable Members
public void Dispose()
{
this.Dispose();
}
#endregion
}
}