Fighting the C # component. What I'm trying to do is take a column that is ntext in my original source, which is split into pipes, and then writes the array to a text file. When I run my component, my output is as follows:
DealerID,StockNumber,Option 161552,P1427,Microsoft.SqlServer.Dts.Pipeline.BlobColumn
I worked with the GetBlobData method and I fought with it. Any help greatly appreciated! Here is the full script:
public override void Input0_ProcessInputRow(Input0Buffer Row) { string vehicleoptionsdelimited = Row.Options.ToString(); //string OptionBlob = Row.Options.GetBlobData(int ; //string vehicleoptionsdelimited = System.Text.Encoding.GetEncoding(Row.Options.ColumnInfo.CodePage).GetChars(OptionBlob); string[] option = vehicleoptionsdelimited.Split('|'); string path = @"C:\Users\User\Desktop\Local_DS_CSVs\"; string[] headerline = { "DealerID" + "," + "StockNumber" + "," + "Option" }; System.IO.File.WriteAllLines(path + "OptionInput.txt", headerline); using (System.IO.StreamWriter file = new System.IO.StreamWriter(path + "OptionInput.txt", true)) { foreach (string s in option) { file.WriteLine(Row.DealerID.ToString() + "," + Row.StockNumber.ToString() + "," + s); } }
source share