我用 C# 写过,你可以把它转换成 VB
您可以根据列类型更改字段类型,例如 item.Field 到 Field
var result = (from item in MF_PATIENT_DIAGNOSES.AsEnumerable()
where item.Field<int>("PATIENT_DIAGNOSIS_ACCOUNT") == 31 && item.Field<string>("PATIENT_DIAGNOSES_STATUS").ToUpper() != "ENTRY ERROR"
orderby item.Field<string>("PATIENT_DIAGNOSIS_DESCRIPTION")
select new
{
PATIENT_DIAGNOSIS_DESCRIPTION = item.Field<string>("PATIENT_DIAGNOSIS_DESCRIPTION"),
PATIENT_DIAGNOSIS_CODE = item.Field<string>("PATIENT_DIAGNOSIS_CODE"),
PATIENT_DIAGNOSIS_ACCOUNT = item.Field<string>("PATIENT_DIAGNOSIS_ACCOUNT"),
PATIENT_DIAGNOSES_STATUS = item.Field<string>("PATIENT_DIAGNOSES_STATUS "),
}).Distinct();
我使用这个http://www.developerfusion.com/tools/convert/csharp-to-vb/转换器转换它
Dim result1 = (From item In MF_PATIENT_DIAGNOSES.AsEnumerable() Where item.Field(Of Integer)("PATIENT_DIAGNOSIS_ACCOUNT") = 31 AndAlso item.Field(Of String)("PATIENT_DIAGNOSES_STATUS").ToUpper() <> "ENTRY ERROR"Order By item.Field(Of String)("PATIENT_DIAGNOSIS_DESCRIPTION")New With { _
Key .PATIENT_DIAGNOSIS_DESCRIPTION = item.Field(Of String)("PATIENT_DIAGNOSIS_DESCRIPTION"), _
Key .PATIENT_DIAGNOSIS_CODE = item.Field(Of String)("PATIENT_DIAGNOSIS_CODE"), _
Key .PATIENT_DIAGNOSIS_ACCOUNT = item.Field(Of String)("PATIENT_DIAGNOSIS_ACCOUNT"), _
Key .PATIENT_DIAGNOSES_STATUS = item.Field(Of String)("PATIENT_DIAGNOSES_STATUS ")
}).Distinct()