how to read the columns from flat file connection Manager programmatically -
06-16-2006
, 08:10 AM
Hi Everybody,
My Goal is Moving Data from Flat file to OLEDB Destination
programmatically using integration services.
I have created a flat file Connection Manager programmatically.
I have set the properities for accesssing the text file.
But, I don't know, how to set the column delimiter property.
here are the following.
Dim cmflatFile As ConnectionManager =
package.Connections.Add("FLATFILE")
'cmflatFile = package.Connections.Add("FLATFILE")
cmflatFile.Name = "FlatFileConnection"
cmflatFile.Description = "FlatFile Connection Manager"
cmflatFile.ConnectionString = sSourceDirectory & DATAFILENAME
cmflatFile.Properties("DataRowsToSkip").SetValue(c mflatFile,
0)
cmflatFile.Properties("ColumnNamesInFirstDataRow") .SetValue(cmflatFile,
False)
cmflatFile.Properties("Unicode").SetValue(cmflatFi le, False)
cmflatFile.Properties("Format").SetValue(cmflatFil e,
"Delimited")
cmflatFile.Properties("RowDelimiter").SetValue(cmf latFile,
vbCrLf)
cmflatFile.Properties("TextQualifier").SetValue(cm flatFile,
"<none>")
cmflatFile.Properties("HeaderRowsToSkip").SetValue (cmflatFile,
0)
cmflatFile.Properties("HeaderRowDelimiter").SetVal ue(cmflatFile,
vbCrLf)
cmflatFile.Properties("CodePage").SetValue(cmflatF ile, 1252)
I have created the flat file source using flat file connection manager.
But, still, i can't read the columns from flat file. Becuase, I am
missing to set the column delimiter property.
Please let me know, how to set the column delimiter property and how to
retrieve the columns from flat file. |