max = e.DataTable.Compute
改成
max = e.DataTable.SqlCompute
------------
e.DataRow("xuhao") = lb.Substring(5,2) & Format(idx,"000000")
e.DataRow.Save