我必须在同一个查询中选择另一列,因为在创建单行时我必须在同一行中添加值。
//代码
'Loop through the transactions
For Each iTransactionid In (From TransactionFieldLinq In transactionFieldsCollection Select TransactionFieldLinq.TransactionId).Distinct
'Create a new data row
DataRow = DataTable.NewRow()
'Set the data row properties
DataRow("TransactionId") = iTransactionid
'Loop through the transaction fields collection
For Each TransactionField In (From TransactionFieldLinq In transactionFieldsCollection Where TransactionFieldLinq.TransactionId = CInt(DataRow("TransactionId")))
'Set the data row properties
DataRow(CStr(TransactionField.FieldId)) = TransactionField.FieldValue
Next
'Add the data row to the data table
DataTable.Rows.Add(DataRow)
Next
transactionFieldCollection
有另一个称为格式的属性StartDate
,DateTime
我还必须在同一查询中选择该StartDate
列并将其绑定到DataTable
类似 TransactionId。
我怎样才能做到这一点?