Click here to Skip to main content
15,914,010 members
Home / Discussions / C#
   

C#

 
GeneralRe: Best Practices - Serializing Dialog Data Pin
Heath Stewart5-Feb-05 3:30
protectorHeath Stewart5-Feb-05 3:30 
QuestionHow to modify the tnsnames.ora file by method? Pin
Colinyin4-Feb-05 13:06
Colinyin4-Feb-05 13:06 
GeneralCant get drag-n-drop from Excel to work. Please help. Pin
Flack4-Feb-05 12:14
Flack4-Feb-05 12:14 
GeneralRe: Cant get drag-n-drop from Excel to work. Please help. Pin
Heath Stewart4-Feb-05 13:23
protectorHeath Stewart4-Feb-05 13:23 
GeneralRe: Cant get drag-n-drop from Excel to work. Please help. Pin
Flack4-Feb-05 14:13
Flack4-Feb-05 14:13 
GeneralRe: Cant get drag-n-drop from Excel to work. Please help. Pin
Heath Stewart4-Feb-05 14:17
protectorHeath Stewart4-Feb-05 14:17 
GeneralRe: Cant get drag-n-drop from Excel to work. Please help. Pin
Flack5-Feb-05 9:49
Flack5-Feb-05 9:49 
GeneralRe: Cant get drag-n-drop from Excel to work. Please help. Pin
Heath Stewart6-Feb-05 6:08
protectorHeath Stewart6-Feb-05 6:08 
And you won't get anything that way. The XML fragment includes a namespace which you must reference or else your XPath statement won't resolve the XML elements. Those XML elements (and attributes, for that matter, though most attributes are not namespace-qualifed) are defined by a namespace.

Unfortunately in the code you're using you cannot add an XmlNamespaceManager anywhere (oddly enough), so you might try setting XmlTextReader.Namespaces to false. This disables namespace support, but what that means from a programming standpoint I'm not really sure. I've never used this technique, before.

Normally, when you'd use something like XmlDocument.SelectNodes you'd first instantiate an XmlNamespaceManager from the XmlDocument.NameTable, add namespaces (with whatever prefixes you want; the prefixes themselves don't have to be the same as what's in the XML document), then select using an XPath expression utilizing the prefixes that match up with the same namespaces that qualifies any elements and attributes as necessary.

A word of caution, too: Excel - beginning with XP, IIRC - only started using XML as a clipboard format. Older Excel versions do not so if you intend supporting older versions of Excel either by interop'ing with an older typelib or not using new functionality from the newer typelib (since COM, when implemented correctly - and Office is a shining example of those rules, does not change published interfaces and typically remains backward compatible) you should not use the XML clipboard format.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralOverriding Uninstall method Pin
Adnan Siddiqi4-Feb-05 12:13
Adnan Siddiqi4-Feb-05 12:13 
GeneralRe: Overriding Uninstall method Pin
Heath Stewart4-Feb-05 13:21
protectorHeath Stewart4-Feb-05 13:21 
GeneralRe: Overriding Uninstall method Pin
Adnan Siddiqi4-Feb-05 20:10
Adnan Siddiqi4-Feb-05 20:10 
GeneralRe: Overriding Uninstall method Pin
Heath Stewart5-Feb-05 3:01
protectorHeath Stewart5-Feb-05 3:01 
GeneralRe: Overriding Uninstall method Pin
Adnan Siddiqi5-Feb-05 4:10
Adnan Siddiqi5-Feb-05 4:10 
GeneralRe: Overriding Uninstall method Pin
Heath Stewart5-Feb-05 4:58
protectorHeath Stewart5-Feb-05 4:58 
GeneralRe: Overriding Uninstall method Pin
Adnan Siddiqi5-Feb-05 8:28
Adnan Siddiqi5-Feb-05 8:28 
GeneralRe: Overriding Uninstall method Pin
Adnan Siddiqi6-Feb-05 2:34
Adnan Siddiqi6-Feb-05 2:34 
GeneralRe: Overriding Uninstall method Pin
Heath Stewart6-Feb-05 5:20
protectorHeath Stewart6-Feb-05 5:20 
GeneralCreating web user control dinamically Pin
see074-Feb-05 12:06
see074-Feb-05 12:06 
GeneralRe: Creating web user control dinamically Pin
Heath Stewart4-Feb-05 13:19
protectorHeath Stewart4-Feb-05 13:19 
GeneralManaged direct3d and vmr9 Pin
natarius4-Feb-05 10:46
natarius4-Feb-05 10:46 
GeneralRe: Managed direct3d and vmr9 Pin
Heath Stewart4-Feb-05 13:17
protectorHeath Stewart4-Feb-05 13:17 
GeneralRe: Managed direct3d and vmr9 Pin
natarius4-Feb-05 13:48
natarius4-Feb-05 13:48 
GeneralRe: Managed direct3d and vmr9 Pin
Heath Stewart5-Feb-05 3:14
protectorHeath Stewart5-Feb-05 3:14 
GeneralRe: Managed direct3d and vmr9 Pin
natarius5-Feb-05 7:57
natarius5-Feb-05 7:57 
GeneralRe: Managed direct3d and vmr9 Pin
Heath Stewart6-Feb-05 5:11
protectorHeath Stewart6-Feb-05 5:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.