If e.DataCol.Name = "项目名称" Then
If e.DataRow.IsNull("项目名称") Then
Dim s As String = e.DataRow("备注")
If s.Length > 10 Then '判断字符串长度
Dim s1 As String = s.SubString(2) '删除前面的2个字符
Dim sps() As Char = {"(","投保金","工程款"} '定义数组
Dim Names() As String = s1.Split(sps) '分割数组
Dim xmmc As String = Names(0) '取分割后的第一个字段
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText ="s elect * from {jy_投标立项} where 1=2" '不加载
Dim dt As DataTable=cmd.ExecuteReader()
For Each r As DataRow In e.DataTable.DataRows
Dim dr As DataRow = dt.Find("项目名称='" & xmmc & "'")
If dr IsNot Nothing Then
r("项目名称") = dr("项目名称")
r("简码") = dr("简码")
r.Save
End If
Next
End If
End If
End If
红色代码,后台查找,无效,因字符串长度不相等
xmmc 字符串只有项目名称的一部份,怎么查找取值