PDA

View Full Version : c# xpath queries



ScotsPine
3rd November 2003, 18:11
does anybody know how to pass in more than a single parameter to an xpath query?

i have...(hope ezboard leaves the code alone)

cmd.CommandType = SqlXmlCommandType.XPath;
cmd.RootTag = "ROOT";
cmd.Namespaces= "xmlns:x ='urn:myschema:PersonDetails'";
cmd.SchemaPath= absPath + "\\referralSchemaForUpdates.xsd";
cmd.CommandText = "PersonDetails[@PersonID=\"_personid\"[PersonDetails/ReferralDetails[@ReferralId=\"_referralid\"]]";

i need to pass two parms into the commandtext.

DimPrawn
3rd November 2003, 19:34
Looks like a little bug has crept into your code :x

If only they were that easy to spot.

I have not idea what the answer is.

Try MSDN, Google or somewhere like experts exchange.

Good luck.

ScotsPine
3rd November 2003, 21:44
yes - that particular bug is 'by design' ;)

AtW
3rd November 2003, 23:04
LOL, ScotsPine, any chance you could give a few good reasons _why_ to use XML/XSLT for a query???

ScotsPine
3rd November 2003, 23:13
1. i'm tired of t-sql
2. diffgrams and updategrams are fun
3. schema/datasets/classes in c# are new
4. xml is native in .net data objects
5. it's fast
6. it's the future
7. it's portable
8. it's scalable
9. it's good with firewalls
10. the client wants it!

:)

AtW
4th November 2003, 00:57
:eek

ScotsPine
4th November 2003, 14:00
fixed :)