c# - Check If Query Exists if Yes - Delete -


I have the following syntax to use C # to delete an access query ... but how do I check Do the query exist? DAO Database DD; DAO.D.B.E.gen. DB = new DAO.Begen (); dd = db.OpenDatabase (path); dd.QueryDefs.Delete (queryName); I also tried to do it - but it can not be assigned to 'equality' because it is a 'law group' that has received a compilation error. >

  var qd = new dao .QueryDef (); If (qd.Name.Equals = "Hello") {dd.QueryDefs.Delete (queryName); }    

You can loop on the QueryDefs collection and check if you get this Has been ... DAO Databases DD; DAoD.B.G.IN DB = new DAO.BEIGIN (); dd = db.OpenDatabase (path); Bull got = wrong; Forchach (dd.o.qdf qd in dd.QueryDefs) {if (qd.Name == "hello") {found = true; }} If (found) {dd.QueryDefs.Delete (queryName); }

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -