Hi,
Try following query.
cmd.CommandText = "if not exists (select * from " + table + " where character='" + textBox1.Text + "' and entity='" + textBox2.Text + "') insert into " + table + " values ('" + textBox1.Text + "', '" + textBox2.Text + "') where not exists";
Thanks,
Bhagyesh