.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

How to retrieve conditional XML data using XPath

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net

 I have a XMLDataSource somewhat like:


I am storing these in a asp:formview. I am able to store author and publication values but not sure how can I store the value of book name? Actually I just want to use condition that I need to store "name" if "genere=Romance". something like this. I know we can use contition/expression in XPath method but if it is an attribute like <book genere="romance">. Can someone throw light on this question.

View Complete Post

More Related Resource Links

How to retrieve conditional XML data using XPath Expression

I have a XMLDataSource somewhat like:

Using Conditional Split data Transfer in SSIS 2008

This article uses the Integration Services Conditional Split Data Transformation element to filter and transfer data from a set of flat text files to SQL Server database table. The concept can be easily extended to apply to any other source or destination such as Microsoft Excel. This scenario is useful in creating denormalized database tables in a reporting and analysis situation.

How to retrieve data from SqlDataSource and pass to a variable?


Hi there,

I have a page in my website where there is very little code-behind. I only have two lines of code in Page_Load() and the rest of the code is declarative ASP.NET code. I have a FormView control which uses a SqlDataSource to get some order information. The SqlDataSource calls a stored procedure called usp_GetOrderDetails, here's the code for the SqlDataSource:

    <asp:SqlDataSource ID="sdsFormOrderDetails" runat="server" 
ConnectionString="<%$ ConnectionStrings:ForexDB %>"
ProviderName="<%$ ConnectionStrings:ForexDB.ProviderName %>"
SelectCommand="usp_GetOrderDetails" SelectCommandType="StoredProcedure"
UpdateCommand="usp_UpdateOrder" UpdateCommandType="StoredProcedure"
<asp:ControlParameter Name="orderId" ControlID="grdOrders" PropertyName="SelectedDataKey.Value" />
<asp:ControlParameter Name="orderId" ControlID="frmOrderDetails" PropertyName="SelectedValue" />

Real-World XML: Manipulate XML Data Easily with the XPath and XSLT APIs in the .NET Framework


XPath is emerging as a universal query language. With XPath, you can identify and process a group of related nodes in XML-based data sources. XPath provides an infrastructure that is integral to XML support in the .NET Framework. The XPath navigation model is even used under the hood of the XSLT processor. In this article, the author reviews the implementation details of the XPath navigator and the XSLT processor and includes practical examples such as asynchronous transformations, sorted node-sets, and ASP.NET server-side transformations.

Dino Esposito

MSDN Magazine July 2003

Programmatically retrieve data from the associated row in SharePoint and use the data to do math


I am trying to pull all of the associated data from a SharePoint list row to an InfoPath form repeating table.  I would like to select 1 unique value from the row and have the other fields auto-populate with the associated data from that row. 


SharePoint Columns and also names of InfoPath fields 1, 2, 3, 4, 5, 6, 7.

I have a dropdown that is connected to column 1 and I would like to select 1 and have it populate the rest of the fields from that row.  I am currently doing this with information and C# code from:  http://www.bizsupportonline.net/infopath2007/sharepoint-list-retrieve-value-same-row-repeating-table-infopath

How can i add a textbox into a GridView Cell dynamically and how can i retrieve entred data

Hey, i think that the the subject can explain what i need, it's about adding a TextBox control with the code behind into a GridView, and also about how can i retrieve entered data after submitting, im using C#,Thanks.

SQL 2008 R2 (final): SSMS freezes: "Failed to retrieve data for this request.

The original thread is locked for some reason--but the cause of the bug had something to do with the "ssms tools pack" add-in, which, according to the comments in the connect item, will be fixed in an update of ssms tools: http://social.msdn.microsoft.com/Forums/en-US/sqlkjdatabaseengine/thread/f65737b7-fe4d-487b-aa41-ef437d100bc7 https://connect.microsoft.com/SQLServer/feedback/details/556169/ssms-completely-locked-up-after-right-clicking-a-table  

No Way to retrieve data from oracle ref:_cursor over T-SQL and linked Server?

Hello, for an migration projekt we want to compare results from sp's from oracle and sqlsserver. Same calls should retrieve same results. Also we want build an automatic test for this. But is there now way to retrieve results from oracle sp's whit rev_cursor over linked Server? No one answer to this: http://social.msdn.microsoft.com/forums/en-us/sqldataaccess/thread/2BAC6743-8701-4476-8F36-0377A5761525   greetings Michael

Retrieve cube data directly from Relational database - is this possible?

I have a cube created in SSAS R2 2008. Now i would like to retrieve some data from this cube, using MDX language, and then to process it in Relational SQL database! Is this possible? I am new in SSAS, please help!  

ssis sql 2000 image to 2008 varbinary Failed to retrieve long data for column

Hi, I have a task that to migrate the image type column from sql 2000 to varbinary type in sql 2008. The source column having 3812353 max datalength size for the column. The package always failed with following error message. [OLE DB Source [13177]] Error: Failed to retrieve long data for column "attch_file_content_t". [OLE DB Source [13177]] Error: There was an error with output column "attch_file_content_t" (13209) on output "OLE DB Source Output" (13187). The column status returned was: "DBSTATUS_UNAVAILABLE". [OLE DB Source [13177]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "attch_file_content_t" (13209)" failed because error code 0xC0209071 occurred, and the error row disposition on "output column "attch_file_content_t" (13209)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. Meng Chew

MDX to retrieve data from Time hierarchy

Hi there, I have a time hierarchy Year->Quarter->Month->Day. I need to get all the level data by one MDX.  Desired result set should look like Year    Quarter    Month    Day  MeasureValue 2010    Q1           Jan       01     1000 2010    Q1           Feb       28     500 Thanks, Palash

retrieve data from emp table????

Hi!   I have employee table containing salary column. I want to retrieve 3rd highest salary from the table. what would be the query for that? I can though of select top (3) salary from emp orderby desc; But I need only one result set. How can i do that?? Thanks,  

Retrieve data from select columns without creating Gridview etc??

I have an accessdatasource with multiple columns, one column I use it to populate a dropdownlist. Can I use the data from other columns to insert into a table,  insert being done in the aspx.vb page, without creating gridview etc.   Is it possible to make a detailsview one column visible= false and still be able to evaluate its contents? Thanks,

Applying conditional formatting to the 'AssignedTo' column does not work in a data view using Shar

This one is throwing me for a loop.  I've joined two lists using "Linked Sources" in SharePoint Designer.  On a new ASPX page I added a data view and added 3 columns (Title, Priority and AssignedTo) as a multi-Item view.   I can select a row and apply conditional formatting to the Title field (changing the background color if @title = 'Parent 1') and the changes are displayed in the design pane.   The only oddity there is that I have to go back and edit the condition in advanced mode, changing the XPath expression from ../../../Rows/Row/@Title = 'Parent 1' to @Title = 'Parent 1'  and then it seems to work just fine. Here's the problem.  I want the condition applied to the AssignedTo column (hide row if 'AssignedTo != 'John Doe')  If I create a condition to hide contents if the AssignedTo = 'John Doe' it creates the XPath expression ../../../Rows/Row/@AssignedTo = 'John Doe'.  When I save it, the row is still visible.  If I edit the XPath expression, changing it to @AssignedTo = 'John Doe' and save it the row is still visible.  The same is true if I simply try to change the background color, conditionally formatted  against the AssignedTo column. Does anyone have any ideas here?              

Using asp.net login control USERID to retrieve data from table using a where clause.


Protected Sub SqlDataSource1_inserting(ByVal sender As Object, ByVal e As SqlDataSourceCommandEventArgs) Handles SqlDataSource1.Inserting
        Dim MemUser As MembershipUser
        MemUser = Membership.GetUser()
        UserID.Text = MemUser.ProviderUserKey.ToString()
        e.Command.Parameters("@UserId").Value = MemUser.ProviderUserKey.ToString()

Lookup conditional caching possible? or flush cache as data changes?


Hi Forum

Is there any way to switch caching setting on the lookup up component on-the-fly? I have a lot of lookup components that I want to use full caching setting - some times I know that there will not be a lot of data - so N lookups or partial caching would be better. I could indicate this by using a variable  - I could use a conditional split to make 2 paths - I could make 2 different lookup components but these two cannot point to the next task in the flow since it seams that all data flow task only take one input path.

I could really also use a way to flush the cache when ever a row value changes. In this way I could order the data by Company, and have it use full caching but flush the cache whenever the company id changes. Is this in any way possible?

Thank you in advance


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