FieldAttributeEnum,DataTypeEnum:VB / ADODB到C#

时间:2016-08-03 14:53:10

标签: c# vb.net adodb

我将一些VB代码转换为C#/ .Net。我需要以下等价物:

  

记录集
  FieldAttributeEnum
  DataTypeEnum

我认为%td.status-data= campaign.status == "Approved" ? '<span title="#{campaign.status}" class="glyphicon glyphicon-ok green center"></span>'.html_safe : campaign.status == "Rejected" ? '<span title="#{campaign.status}" class="glyphicon glyphicon-remove red center"></span>'.html_safe : campaign.status 可能会替换为RecordSet,但我不了解其他两个。有什么想法吗?

一些示例代码:

DataSet

1 个答案:

答案 0 :(得分:0)

正如已经指出的那样,它不是直接翻译。正如@David所说,SELECT COALESCE(Q1.[group name],Q2.[group name]) AS [date], Q2.[tickets open], Q1.[tickets closed], COALESCE(Q1.TheDate,Q2.TheDate) as [date] FROM (SELECT g.Name As 'Group Name' ,COUNT(*) As 'Tickets Closed', CAST(t.ResolvedAt AS DATE) As 'TheDate' FROM Tickets t JOIN Groups g ON g.ID = t.AssignedGroup GROUP BY CAST(t.ResolvedAt AS DATE), g.Name) Q1 FULL OUTER JOIN (SELECT g.Name As 'Group Name' ,COUNT(*) As 'Tickets Closed', CAST(t.ResolvedAt AS DATE) As 'TheDate' FROM Tickets t JOIN Groups g ON g.ID = t.AssignedGroup GROUP BY CAST(t.ResolvedAt AS DATE), g.Name) Q2 ON Q1.[group name] = Q2.[group name] AND Q1.TheDate = Q2.Thedate 可以有多个表,但我只需要一个。另请注意@AndrewMortimer在评论中给出的链接,这很有帮助。代码现在看起来像这样:

DataSet