参考代码,每个列,要分开写。
Dim dr As DataRow = e.DataRow
Select e.DataCol.Name
Case "工程名称"
If dr.IsNull("工程名称") = False AndAlso dr.IsNull("会议名称") = False Then
Dim opath As String = ProjectPath & "Attachments\用户工程\" & e.oldvalue & "\" & dr("会议名称")
Dim npath As String = ProjectPath & "Attachments\用户工程\" & e.newvalue & "\" & dr("会议名称")
If FileSys.DirectoryExists(opath) = False Then '如果目录不存在
FileSys.CreateDirectory(npath) '创建目录
Else
FileSys.MoveDirectory(opath,npath)
End If
Else
MessageBox.Show("工程名称及会议名称不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
End Select