Sql query in ASP.NET -
i using following query update record in asp.net, what's wrong it?
dim updatesqlstring string = "update subscriber_communication set([[marketing_rec_id]=?, [currently_own]=?,[purchase_date]=?, [interested_in_owning]=?, [product_of_interest]=?," & _ "[time_frame_to_own]=?, [referred_by]=?, [campaign_code]=?,[last_update]=?, [record_created_on]=?, [comments]=?, [comment_date]=?, [community_id]=?," & _ "[certification]=?, [subscriber_type]=?, [unsubscribe_comment]=?" & _ "where [communication_id]=" & communication_id using conn new sqlconnection(connstring) using cmd new sqlcommand(insertsqlstring, conn) cmd.commandtype = commandtype.text cmd.parameters.addwithvalue("marketing_rec_id", marketing_rec_id) cmd.parameters.addwithvalue("currently_own", currently_own) cmd.parameters.addwithvalue("purchase_date", purchase_date) cmd.parameters.addwithvalue("interested_in_owning", interested_in_owning) cmd.parameters.addwithvalue("product_of_interest", product_of_interest) cmd.parameters.addwithvalue("time_frame_to_own", time_frame_to_own) cmd.parameters.addwithvalue("referred_by", referred_by) cmd.parameters.addwithvalue("campaign_code", campaign_code) cmd.parameters.addwithvalue("last_update", last_update) cmd.parameters.addwithvalue("record_created_on", record_created_on) cmd.parameters.addwithvalue("comments", comments) cmd.parameters.addwithvalue("comment_date", comment_date) cmd.parameters.addwithvalue("community_id", community_id) cmd.parameters.addwithvalue("certification", certification) cmd.parameters.addwithvalue("subscriber_type", subscriber_type) cmd.parameters.addwithvalue("unsubscribe_comment", unsubscribe_comment) conn.open() cmd.executenonquery() end using end using
i believe want:
dim updatesqlstring string = "update subscriber_communication set [marketing_rec_id]=@marketing_rec_id, [currently_own]=@currently_own, ..." etc
Comments
Post a Comment