题主这SQL语句根本都没执行,当然不会更新:
cmd.CommandType = CommandType.Text; // 设置命令是SQL语句cmd.ExecuteNonQuery(); // 执行命令cmd.Dispose(); // 释放资源