Hello,
The result of a mathematical operation with non numeric value will turn into null so you can give a try to replace isnumeric with the following:
select max(cast(your_column as integer)) from your_table where ifnull(your_column + 1, null) is not null
Note 1: Why do you not use ExecuteScalar()?
Note 2: Try to use as much as possible parameterized queries instead of concatenations
Edit:
select 'A' || substr('00000000' || cast(max(cast(substr(product_code, 2) as integer)) + 1 as text), -4) from products where substr(product_code, 1, 1) = 'A'
"substr(product_code, 2)" gives you numeric part
"cast(max(cast(substr(product_code, 2) as integer)) + 1" gives you next id
the last substr gives you a formatted numerical id
the last concatenate gives you what you want