2017-11-13 13 views
1

SSIS pakageを実行していて、C#経由でほとんどの作業を行いましたが、追加しようとしているのは各出力テキストファイルのレコード数です。これまでに何も試みません、私はエラーを取得するか、私はすべてのファイルにファイルを置く最初のカウントを取得します。お願いします。おかげ は、この私のスクリプトですSSIS with C#各ファイルの行数を取得しようとしました

    // Write the Header Row to File 
        int ColumnCount = d_table.Columns.Count; 


        // Dts.Events.FireInformation(0, "DataTable Rows", RecordsInserted.ToString(), "", 0, ref fireAgain); 

       // 

        // Write All Rows to the File 
        foreach (DataRow dr in d_table.Rows) 
        { 
         for (int ir = 0; ir < ColumnCount; ir++) 
         { 
          if (!Convert.IsDBNull(dr[ir])) 
          { 
           sw.Write(dr[ir].ToString()); 
          } 
          if (ir < ColumnCount - 1) 
          { 
           sw.Write(FileDelimiter); 
          } 
          // RecordsInserted = dt.Rows.Count; 
          // Dts.Events.FireInformation(0, "DataTable Rows", RecordsInserted.ToString(), "", 0, ref fireAgain); 

         } 

         sw.Write(sw.NewLine); 

        } 
        ///////////////////// 
        sw.Write(",Insurance," + rctn); 
        sw.Write(sw.NewLine); 
        // sw.Write("Row count: " + RowCount.ToString()); 
       this is some of what i tried but nothing works for me 


        //  sw.Write("Row count: " + RowCount.ToString()); 

        sw.Close(); 
       } 

      } 

     } 
+0

どうしたらいいですか? – PrestonM

答えて

0

あなたのコード例では、不完全に見えますが、私はどこにもRowCountのない宣言がありません気づきました。それはあなたが必要とするものですか:

sw.Write("Row count: " + d_table.Rows.Count.ToString()); 
関連する問題