c# - Use in operator in stored query in ms access with ado.net -
following stored query in ms access
update tblcontacts set isactive = 0, dtupdated = vdtupdated contactid in (vcontactid);
contactid integer.
following c# code executes above stored query
public void delete(string contactid) { using (var cm = new oledbcommand()) { cm.connection = accessconnection(); cm.commandtype = commandtype.storedprocedure; cm.commandtext = "deltblcontacts"; cm.parameters.addwithvalue("vdtupdated", datetime.now.tostring()); cm.parameters.addwithvalue("vcontactid", contactid); cm.connection.open(); cm.executenonquery(); cm.connection.close(); } }
when execute above code, not single record affected.
i feel passing data stored query in string form pain point.
Comments
Post a Comment