correct first..
SELECT max(isnull(id,0))+1 FROM [TBL_CATEGORYCUSTOMERS]
And Your answer is according to your procedure, eventually that is a wrong produce....
if(dt3.Rows.Count>0)
{
textbox.Text=dt3.rows[0][0].tostring();
}
you are using the wrong procedure to select the max Id.
For simplest procedure see
@DamithSL solution..