如何从C#或Vb.net中的Datagridview或Datatable生成IIF文件(QuickBook文件)

时间:2016-12-05 09:46:45

标签: c# .net vb.net datatable quickbooks

提前致谢:

如何从C#或Vb.net中的Datagridview or Datatable生成Public Shared Sub Write(dt As DataTable, filePath As String) Dim i As Integer = 0 Dim sw As StreamWriter = Nothing sw = New StreamWriter(filePath, False) For i = 0 To dt.Columns.Count - 2 sw.Write(dt.Columns(i).ColumnName + " ") Next sw.Write(dt.Columns(i).ColumnName) sw.WriteLine() For Each row As DataRow In dt.Rows Dim array As Object() = row.ItemArray For i = 0 To array.Length - 2 sw.Write(array(i) + " ") Next sw.Write(array(i).ToString()) sw.WriteLine() Next sw.Close() End Sub

我想从DataTable生成IIF文件。

我试过了:

这仅生成数据到标签分隔符

Full Name Start Date/Time Hours Mileage ConvertedDate
"ALLEN  SERINA " 11/17/2016 7:09AM CST 7.433333333333334  11/17/2016   12:00:00      AM
"ARMSTRONG   VANESSA " 11/17/2016 11:14PM CST 8.205274722222223  11/17/2016 12:00:00 AM
"BATTLE  BRANDON" 11/17/2016 6:08AM CST 8.133333333333333  11/17/2016 12:00:00 AM
"BEAL  PATRICIA" 11/17/2016 10:00AM CST 8.5  11/17/2016 12:00:00 AM
"BENNETT  AUIRIEL" 11/17/2016 3:06PM CST 7.574134722222222  11/17/2016 12:00:00 AM
"BRATCHER  SHEMEKA" 11/17/2016 4:27PM CST 6.150830555555555  11/17/2016 12:00:00 AM

但我想整合Qb Employee所以,请提供Employee tab delimeter。

我收到了此输出

{{1}}

请为今天进入IIB编码进入QB员工TimeEntry。

0 个答案:

没有答案