Hi
Try like this in first query u use cmd.CommandText and second query also cmd.CommandText so try to declare different cmd(like cmd,cmd1)or if u execute first query u need to dispose the cmd ,i think cmd as sqlcommand ? is it if u use same object u need to dispose like cmd.Dispose() then again u assign the query to cmd.And one this in each function or each query u need to use dispose,close connection then only it not affect in other place,what u try above in same function u try to execute 2 queries with same sqlcommand object,so u have dispose or declare new name cmd.
cmd.CommandText = "INSERT INTO AD_DETAIL (CAT_ID, SUB_CAT_ID, AD_TITLE, AD_DESC, AD_PRICE, AD_IMG, BUY_SELL_ID,DATE,AD_POST_DATE,DELETED_AD) VALUES (" + ddlCountry.SelectedValue + "," + ddlState.SelectedValue + ",'" + txtTitle.Text + "','" + txtDesc.Text + "','" + txtPrice.Text + "','" + "Images/" + uniquefilename + extension + "','" + rbPost.SelectedValue + "', @date,@postdate,0)";
cmd.Parameters.AddWithValue("@date", date.Date.ToLongDateString());
cmd.Parameters.AddWithValue("@postdate", datepost.Date.ToLongDateString());
cmd.Parameters.AddWithValue("@ImagePath", "Images/" + uniquefilename);
cmd.ExecuteNonQuery();
cmd.CommandText = "INSERT INTO SELLER_DETAIL (SELLER_NAME, SELLER_EMAIL_ID, SELLER_MOB_NO, SELLER_DEP, SELLER_FLOOR,EMP_ID) VALUES ('" + txtName.Text + "','" + txtEmailID.Text + "'," + txtContact.Text + ",'" + txtDep.Text + "','" + txtFloor.Text + "','" + txtEmpNo.Text + "')";
Regards
Aravind