in page load i am counting parameters and checking it to some const value then entering to some action codes, else displaying error msg like 'please provide values'. so whenever i am browsing 'http://192.168.1.22:8091/UserPayment.aspx?OID=1024&MID=10&CID=102&UID=92&PAMT=50&TOT=03082015142000&CPHNO=9000959239&RCPT=1024&CHKNUM=0&TT=2'
thowing an error : The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Receive_Payment_CompanyRegistered". The conflict occurred in database "crm", table "dbo.CompanyRegistered", column 'Comp_Id'. The statement has been terminated. where as after debugg application directly not throwing any error its excecuting and inserting record sucessfully.
if (numberOfParameter == 10) { int OrranizationID = 0, MachineID = 0, empId = 0, customerId = 0; string PhoneNo = Request.QueryString["CPHNO"] == null ? "0" : Request.QueryString["CPHNO"].ToString(); string RecieptNo = Request.QueryString["RCPT"] == null ? "0" : Request.QueryString["RCPT"].ToString(); string ChequeNo = Request.QueryString["CHQNUM"] == null ? "0" : Request.QueryString["CHQNUM"].ToString(); string PaidAmnt = Request.QueryString["PAMT"] == null ? "0" : Request.QueryString["PAMT"].ToString(); string TransactionTime = Request.QueryString["TOT"] == null ? "0" : Request.QueryString["TOT"].ToString(); OrranizationID = Convert.ToInt32(Request.QueryString["OID"] == null ? "0" : Request.QueryString["OID"].ToString()); MachineID = Convert.ToInt32(Request.QueryString["MID"] == null ? "0" : Request.QueryString["MID"].ToString()); empId = Convert.ToInt32(Request.QueryString["UID"] == null ? "0" : Request.QueryString["UID"].ToString()); customerId = Convert.ToInt32(Request.QueryString["CID"] == null ? "0" : Request.QueryString["CID"].ToString()); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Please provide PaymentInfo');", true); }

Manas MohapatraPosted Aug 6, 2015, 1:51 AM
Dawood AbbasPosted Aug 6, 2015, 1:43 AM
Manas MohapatraPosted Aug 6, 2015, 1:36 AM