比如
Dim filter2 As String = " 申请编号 = '" & e.DataRow("申请编号") & "'"Dim cmd1 As New SQLCommandcmd1.ConnectionName = "ShenJiRuanJian"cmd1.CommandText = "Sel ect Sum(借方金额) as 借方金额,Sum(贷方金额) as 贷方金额 From {项目收付} Where " & filter2