Hi,
Along with a bunch of files(fixed length files) that need to be loaded into our database we get a Stats file which lists number of rows & columns in each file. Before loading each file I am trying to get row count & column count and compare it with the values in Stats file to make sure we got the full file. I have the c# code to get row count which I included in a Script task in the Control flow
using (StreamReader r = new StreamReader(Dts.Variables["FileName"].Value.ToString())) { string line; while ((line = r.ReadLine()) != null) { Dts.Variables["RowCount"].Value = Convert.ToInt32(Dts.Variables["RowCount"].Value.ToString()) + 1; } } MessageBox.Show(Dts.Variables["RowCount"].Value.ToString());Please help me with a script that'll give me column count too. Newbie in c#. Thanks in advance!