//两种方法
1.
//string updateSql = "";
//if (filePath1 != "")
// updateSql += "aaaaa='" + filePath1 + "',";
//if (filePath2 != "")
// updateSql += "aaaaa='" + filePath2 + "',";
//if (filePath3 != "")
// updateSql += "aaaaa='" + filePath3 + "',";
//if (filePath4 != "")
// updateSql += "aaaaa='" + filePath4 + "',";
//if (filePath5 != "")
// updateSql += "aaaaa='" + filePath5 + "',";
//updateSql = updateSql.Remove(updateSql.Length-1,1);
//sql = string.Format("update 数据库名.dbo.aaa set {0} where ID = {1}",updateSql,ID);
2.
sql = "update 数据库名.dbo.aaa set aaaaa=isnull(null,'" + filePath1 + "'),aaaaa=isnull(null,'"+ filePath2 + "'),aaaaa=isnull(null,'"+ filePath3 + "'),aaaaa=isnull(null,'"+ filePath4 + "'),aaaaa=isnull(null,'"+ filePath5 + "') where ID='" + ID + "'";