Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I had done to avoid duplicate records while entering in sql query itself now its working fine but not showing any message like value Exists already.so here i entered my c# code

C#
case "N":
               {
                   int userid = Convert.ToInt32(Session["sessionid"].ToString());
                   object[,] objsave = new object[18, 2]
              {
            {"@date_e",convdate },
           {"@date_a",txtDatea.Text.ToString() },
           {"@ContactID",txtcontactid.Text},
           {"@subscriptionTypecode",Convert.ToInt32(ddlsubscriptiontype.SelectedValue)},
           {"@eventid",ddlevent.SelectedValue},
           {"@contacttypecode",ddlparticipated.SelectedValue},
           {"@Donationtypecode",ddldonation.SelectedValue},
           {"@Donationworth",txtdonworth.Text},
           {"@PaymentMode",ddlpaymentmode.SelectedValue},
           {"@PaymentReference",txtpayreference.Text},
           {"@PaymentDate_e",convdtpaydate},
           {"@PaymentDate_a",txtpayDatea.Text.ToString()},
           {"@bankname_e", ddlbankname.SelectedValue},
           {"@bankname_a",txtbanknamea.Text},
           {"@remarks_e",txtremarkse.Text},
		   {"@remarks_a",txtremarksa.Text },
           {"@donatedas",RBLdonatedas.SelectedValue},
           {"@userid",userid}
           
      };
                   ds = DBTask.ExecuteQuery_SP("sp_inserteventparticipationentry", objsave);

                   break;



please suggest me where to do that script
Posted
Updated 2-May-13 23:40pm
v2
Comments
ChienVH 4-May-13 12:47pm    
I think before you inserting the new data then you should have a step to check the existence of that data. If it is already in db, then showing a message. If not, then inserting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900