public static int UpdateCategory(ArrayList arrayList) { int count = 0; string sql = "update Categories set CategoryName = @catName, [Description] = @desc where CategoryId = @catId"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@catId", SqlDbType.Char), new SqlParameter("@catName", SqlDbType.NVarChar), new SqlParameter("@desc", SqlDbType.NText) }; // Gán giá trị cho các tham số giả định for (int i = 0; i < arrayList.Count; i++) { param[i].Value = arrayList[i]; } count = Database.ExecuteSQL(sql, param); return count; }