If e.DataCol.Name = "照片" Then Dim dr As DataRow = e.DataRow If dr.IsNull("检查人") Or dr.IsNull("检查日期") Then MessageBox.Show("检查人和检查日期不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.Cancel = True Else e.SubFolder = dr("检查日期").Date & dr("检查人") End If