.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

need value of node

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :Sql Server
how can we get value for each node in second column of table in below query, DECLARE @StrXML XML SET @StrXML = '<PDI_Approval_Message> <Header> <SourceSystem Value ="PDI/Workforce" Name ="WF"></SourceSystem> </Header> <Transactions> <Transaction> <Attributes> <WF_Employee>625</WF_Employee> <WF_Position>Clerk</WF_Position> </Attributes> </Transaction> </Transactions> </PDI_Approval_Message>' CREATE TABLE #XML_Txn_Attrib (Metadata_Attribute_Name VARCHAR(100), Value VARCHAR(100)) INSERT INTO #XML_Txn_Attrib(Metadata_Attribute_Name) SELECT DISTINCT x.y.value('local-name(.)', 'VARCHAR(MAX)') AS Node_Name FROM @StrXML.nodes('//PDI_Approval_Message/Transactions/Transaction/Attributes/*') AS x(y) SELECT * FROM #XML_Txn_Attrib DROP TABLE #XML_Txn_Attrib

View Complete Post

More Related Resource Links

Display homepage node along with child nodes


If the first Sitemap node is your homepage/default and all other nodes are supposed to be children / grandchildren of the first sitemap node in a web.sitemap, how do I set up my web.sitemap to enable me to display my cssFriendlyMenu with the homepage node along with the nodes that are 1 level down from it at the same time as in :

Home   Products   Services   About us


...or is it not possible to have the first sitemap node displayed along with the nodes that are 1 level down from it?  Do I need to have a different starting node rather than my homepage node?

ImageURL SiteMap Node


Hi Can anyone tell me how i can add the ImageURL from a sitemap into a navigation menu, i had this working with webforms but cannot get it to work with mcv

var sbMenuHelper = new StringBuilder();

sbMenuHelper.Append("<ul class='cssMenu'>");

var topLevelNodes = SiteMap.RootNode.ChildNodes;
foreach (SiteMapNode node in topLevelNodes)
    if (SiteMap.CurrentNode == node)
        sbMenuHelper.AppendFormat("<a href='{0}'>{1}</a>", node.Url, helper.Encode(node.Title));

return sbMenuHelper.ToString();

        description="Contact Us"

Addressing a specific node with CSS Friendly Control Adapters


Hello everybody,

I like the concept of the friendly control adapters, but I'm not sure if I can use them for my purpose.
My whole menu basically consist of one image, which itself contains the images for each menu item (is that understandable?).

Each menu item then displays only a certain part of the image.
I do this by shifting the background-position.

#navigation li#home a{
background-position:0px 0px;

/* Registration */
#navigation li#registration a:link, li#registration a:visited {
background-position:-106px -34px;

#navigation li#registration a:hover, li#registration a:focus {
background-position:-106px 0px;

/* Administration */
#navigation li#administration a:link, li#administration a:visited{
background-position:-212px -34px;

#navigation li#administration a:hover, li#administration a:focus{
background-position:-212px 0px;


I would like to do the same now with CSS Friendly, but I don't see how I can address each individual menu item node.
In static HTML I can give each link an ID (i.e. #administration), but I don't see how to do this with the asp:Menu control and CSS Friendly.

Can someone help me?

Thanks a lot,

(Imperfect) Solution to TreeView Postback / Client-Side Node Selection Issue


I've seen this question posted on all corners of the web... "How do I disable "AutoPostBack" on the ASP.NET 2.0 TreeView control?!"  Unfortunately, most of the answers either don't work, miss the point (don't work right), or boil down to "You can't do it."  I happen to know that this behavior worked perfectly in the IEWebControls TreeView that Microsoft released as an add-on prior to ASP.NET 2.0, however.  So I set out to find a solution for the ASP.NET 2.0 TreeView issue.

In a nutshell, the behavior that I and others are looking for is to have a TreeView rendered in a page that allows the user to expand, contract, and select nodes within the TreeView without causing a PostBack to the server.  This implies two things: (1) the most recently-selected node should be recorded as the currently-selected node [i.e., at PostBack time, the most-recently selected node is actually represented as the SelectedNode]; and (2) the selected node should exhibit the SelectedNodeStyle as specified in the TreeView declaration.

It appears that the TreeView engineers saw only two possible outcomes from selecting a leaf node in a tree: (1) immediately posting back to the server, or (2) immediately navigating to another web page.  They apparently did not consider option (3) just allowing selection in-place on the client, while waiting for a click on so

Node probability distibution - values don't sum to 1?

Hi, I am using sequence clustering algorithm and I have checked Node probability distribution (state transition) for one of the cluster. Probability values don't sum to 1. Why? I think they should. Do I miss something?

LinQ to check if xml node exists in the XML??

Using LinQ or any C# syntax, I just want to know whether "Item" Child exists or not if the parent Node (ChildMenuSelected>>MenuSelected) are true from the below xml format.Xml Format:<MenuDataResult> <Items> <Item> <ItemType>Submenu</ItemType> <ItemTitle>Level22</ItemTitle> <Menu> <MenuSelected>false</MenuSelected> <ChildMenuSelected>false</ChildMenuSelected> </Menu> </Item> <Item> <ItemType>Submenu</ItemType> <ItemTitle>Level21</ItemTitle> <Menu> <MenuSelected>false</MenuSelected> <!--if ChildMenuSelected = true --> <ChildMenuSelected>true</ChildMenuSelected> <Item> <ItemType>Submenu</ItemType> <ItemSubType>0</ItemSubType> <Menu> <!--if MenuSelected = true --> <MenuSelected>true</MenuSelected> <ChildMenuSelected>false</ChildMenuSelected> <!-- whether this below item exists or not --> <Item> <ItemType>Submenu</ItemType> <Menu> <MenuSelected>false</MenuSelected> <ChildMenuSelected

MOSS Site with Basic Authentication and variations does not work on one node

Hi, We have one MOSS Farm with two nodes, on this we have several sites. For one specific site we have Basic Authentication and variations enabled in it, on one node site works fine. When we browse it pops-up for credentials and once credentials are provided it works fine and properly redirect to source variation home page. But on the other node when we browse the site it pops-up asking for credentials then after providing correct credentials it again asks for credentials twice and then it throws the following error : Access denied.   You do not have permission to perform this action or access this resource. And if we directly put the source site homepage url it throws following error: 401 UNAUTHORIZED We have checked the Alternate Access Mappings for the site and it is perfectly fine, if i enable windows authentication on the defected node the site works fine. This issue is just like pain in the neck still no resolution, please help us to resolve this issue. Regards, Jasjeet Singh

How can i update treeview root node every time based on the record entries

Hi all, I will have an mdi form and with a treeview which has it's initial property as visible =false. If i select an option from menu a child form will exists i will fill some details and click on save when ever click on save i will make the root node of the treeview to some name as File[batch count:0]. Now if i select another option from menu another form will appear and if i fill it with some details and click on save i would like to change the root node name to File[batch count:1] and a child node should exists with some name

On escape key while editing a treeview node

On hitting escape key while editing a treeview i would like to cancel the editing a would like to show the default name that was previously there. Where should i handle this can any one tell me please..    

Last node in TreeView

Hi everybody.... How are you.... i think everything is all right...... now i have a question.... how to get the last node in treeview ??????? Thankssss.....

SQL 2008 64 Bit 2 node cluster

I wanted to get some feedback on how much memory and CPUs I needed for each node in a 2 Node Cluster. The operating System will be Windows 2008 R2 64 bit Enterprise and the SQL version will be SQL 2008 R2 64 Bit. It will have a total of 8 instances of SQL Server. 2 of those instances will be SQL Server Reporting Services ( 1 SQL Native and the other SharePoint enabled). This cluster will have both nodes in a virtual enviroment. Any feedback would be greatly appreciated.

Ok, XPath expert... how to access this node??

I need to alter the "something else" attribute in the xml below. The only way the correct 'category' node can be found is by finding the right 'subCat', in this case the subcat with a subCatTypeCode equal to 'B'.<root> <category> <subCat subCatTypeCode='A' /> <features> <item id='5678' attribute='something'/> </features> </category> <category> <subCat subCatTypeCode='B' /> <features> <item id='5678' attribute='something else'/> </features> </category> </root>  If you try to do something like the below, you will end up with the FIRST 'item' node.  XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(sXML); XmlNode node = xmlDoc.SelectSingleNode("//category/subCat[@subCatTypeCode='B']").ParentNode.SelectSingleNode("//features/item[@id='5678']"); Please... how to do this?  Thanks.

Treeview - how to change node icon depending on node contents

I have a treeview in an MVVM application: <TreeView ItemsSource="{Binding RootNodes}"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> <Setter Property="FontWeight" Value="Normal" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="FontWeight" Value="Bold" /> </Trigger> </Style.Triggers> </Style> </TreeView.ItemContainerStyle> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <TextBlock Text="{Binding NodeName}" /> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> The treeview is bound to an ObservableCollection called RootNodes. Elements in the RootNodes collection expose a member "NodeName" which is the text for the nodes in the treeview at runtime. They also expose a member called "NodeType", effectively an enumeration that indicates what type of icon should be displa

validate xml node value

Hello All,   I have generic input XML to my system like below where <<Attributes> has different child element for different XML and more than one <Transaction> can comes in one XML, below are 2 samples XML where child node are different under < Attributes>,   Now, I need to check these elements (<WF_Company_ID>, <WF_Company_Name> from XML – 1 and <Inv_Company_ID> and <InV_Company_Name> from XML – 2) must have some value?   Is there any way to check in generic way by TSQL?   Below SQL query read all value of XML in generic way and put them into a temp table,   XML - 1,   <PDI_Approval_Message> <Header> <SourceSystem Value=" Workforce" Name="WF"></SourceSystem> </Header> <Transactions> <Transaction> <Attributes> <WF_Company_ID>200</WF_Company_ID> <WF_Company_Name>XYZ</WF_Company_Name> </Attributes> </Transaction> <Transaction> <Attributes> <WF_Company_ID>201</WF_Company_ID> <WF_Company_Name>XYZ</WF_Company_Name> </Attributes> </Transaction> </Transactions> </PDI_Approval_Message>   XML - 2, <PDI_Approval_Message> <Header> <SourceSystem Value="Ent" Na

Adding second node to SQL Server cluster fails.

I have successfully created a MSCS cluster and I have the SQL cluster up and running on the first node.   When I put the install cd in the second node and go through the install it fails with the error SQL Server Setup has encountered the following error:  Object reference not set to an instance of an object. I'm assuming I get this error because on the cluster node configuration screen the "cluster network name" box is blank.   It won't let me select a name or type a name. The SQL cluster is up and running on the first node.   I can ping the sql cluster network name from both boxes.   The setup shows the installed node and the node I"m trying to add, so I don't see any problem. I have Windows 2008 R2 on both nodes and I'm installing SQL Server 2008 R2.   Any idea how I can get past this error?    Thank you.

Last node in TreeView

Hi everybody.... How are you.... i think everything is all right...... now i have a question.... how to get the last node in treeview ??????? Thankssss.....
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend