dbTalk Databases Forums  

How do I obtain a FlatFileColumn object?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How do I obtain a FlatFileColumn object? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Amnon
 
Posts: n/a

Default How do I obtain a FlatFileColumn object? - 09-10-2006 , 11:02 AM






Hello all

I am writing a custom flat file pipeline source component, and would like
to reference an existing flat connection and use its columns definition.

I could get a reference to my ConnectionManager object -
myFlateFileConnection and trying to get its coulmns through:

IDTSConnectionManagerFlatFile90 ff90 =
(IDTSConnectionManagerFlatFile90)myFlateFileConnec tion.InnerObject;
DTSConnectionManagerFlatFileColumns90 cols = ff90.Columns;

int cnt = cols.Count;
IEnumerator enm = cols.GetEnumerator();
bool more = enm.MoveNext();
IDTSConnectionManagerFlatFileColumn90 nextCol;

while(more)
{
nextObj = enm.Current;
nextCol =
(IDTSConnectionManagerFlatFileColumn90)enm.Current ;
// ...
// I GET HERE ALL THE PROPERTIES OF THE COLUMNS
// BUT NOT THE NAME OF THE COLUMN ???
//
more = enm.MoveNext();
}

IDTSConnectionManagerFlatFileColumn90 interface provides information about
the column - except the main property - the name.

The documentation specifies that users should use the FlatFileColumn but
there is no trace to instructions how to get it.

Can anyone tell me how to get the FlatFileColumn object?

Thanks
Amnon



Reply With Quote
  #2  
Old   
Fil
 
Posts: n/a

Default RE: How do I obtain a FlatFileColumn object? - 11-05-2006 , 09:10 PM






Hello Amnon,

You cannot (at least i've tried hard enough) to convert a IDTSConnectionManagerFlatFileColumn90 into a FlatFileColumn object, but there is a way to get it's name. The example is posted by Microsoft but it is a little bit hidden... Here it goes, just completing your code:

nextCol = (IDTSConnectionManagerFlatFileColumn90)enm.Current ;

IDTSName90 name = nextCol as wrap.IDTSName90; //this Interface represents the name of various objects from the DTS namespace

string colName = name.Name; //There it goes! here is the name of the column

I Hope it helps!
Fil

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.