Firstly learn about SQL Injection and it's dangers, then how to avoid it - e.g. from
http://www.dotnetperls.com/sqlparameter[
^]
That is going to prompt you to rewrite the line of code which is currently
if (ob.dml_statment("insert into onlinepatient_reg values('" + pn.Text.Trim() + "','" + drdge.Text.Trim() + "','" + age.Text.Trim() + "','" + pq.Text.Trim() + "';'" + drddept.Text.Trim() + "','" + drddoctor.Text.Trim() + "','" + pno.Text.Trim() + "','" + email.Text.Trim() + "','" + add.Text.Trim() + "','" + drdcon.SelectedItem.Text + "', '" + drdst.SelectedItem.Text + "','" + drdcit.SelectedItem.Text + "','" + "')") > 0)
When you have done that you will spot a semi-colon
;
where no semi-colon should be, and what appears to be extraneous characters at the end of the values list
,'" + "'
If you had enclosed the attempt to write to the database in a
try-catch
block you may have been able to capture the SQL error that resulted. See
http://www.dotnetperls.com/catch[
^]