.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

Issue travasering xml document with XmlReader

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
hi asp.net 4.0, visual studio 2010 I'm having trouble looping through the contens of the xml document using XmlReader. The problem is not exactly with xml but it lies in how to create this loop. Below I've posted an example of the code.  This is the problem: When reader.Name == "car" I know it's on the beginning of a new xml node in the xml file. Then the loop loops through and set the values to the rest of the values for the item object. Once again if reader.Name == "car" and item has a value, then the item is added to the returnlist. So basically I'm looking for ideas to make this code cleaner and safer (less likely to fail). I'm new to xml and this code looks terrible. I don't like the idea that I don't find all the data to one Car object in one loop, instead I have to use multiple loop runs before I get all the data. I coould use XmlDocument if that is cleaner, it's slower but the xmlfile is so little that no user is able to notice a differencereturnList List<Car> = new List<car>();Cars item; while (reader.Read()) { if (reader.Name == "car") { if (item != null) returnlist.Add(item); item = new Car(); } else if (reader.Name == "model") { item.Model = reader.Value; } else if (reader.Name == "engine") { item.Engine = reader.Value

View Complete Post

More Related Resource Links

Re-authentication issue when openeing a MS Word Document


We have a SharePoint installation for one of our clients with external access enabled using https via ISA server. When accessing the portal internally within the intranet/domain its fine. In case of external access using https when users login to portal adn when they try to open a MS Word (or any Office) document they are prompted to to enter their username and password again. It happens for every MS Office document. We are using MOSS 2007, Office 2007. I know that the promp for re-authentication is is due to the fact that office try to open a new session but is there any work around to overcome this.

Any help will be highly appreciated.



Check-out issue when opening a document from a document library when a read-only copy is open

We have an issue when a user has a read-only copy of a document from SharePoint open and then tries to check-out and edit another copy of the document (i.e. from the document library) the checked out copy is not connected to the web server. For the user it will look the same they will make edits, save and then close, but when they do so the document is not updated in SharePoint - it may be saved locally in their SP drafts, but the user will think that they have lost their version. We then get the checked out to another user error and you have to discard changes to get the document working again. Steps to reproduce this issue: * click on the name of a office doc on a Document Library * Make sure "Read Only" is selected and click "ok" * Minimize open document * click on the same file on the Document Library * Make sure "check out and edit" is selected and the "Use my local drafts folder" checkbox is ticked. Select OK. * Edit document and press save. Changes are never saved back in SharePoint, they are only on the local draft. We are using MOSS with SP2. Clients are on Office 2003 and 2007 Is this normal behaviour? Is there anything that can be done to prevent this from happening?

XmlReader.Create(textReader, XmlReaderSettings) Validation Issue

For the most part, when I perform an XmlReader.Read() I am catching validation errors based on my schemas.  This, however, is a large group of schemas with several imports and includes.  My question is why I'm having validation errors in two places that seem to be defined in the schema.   Here's an example:   Schema 1 (you can see that IdentificationType has sub-elements for IdentificationID and IdentificationCode):   <xsd:complexType name="IdentificationType">                 <xsd:annotation>                         <xsd:documentation>A data type for a representation of an identity.</xsd:documentation>                         <xsd:appinfo>                                 <i:Base i:namespace="http://niem.gov/niem/structures/2.0" i:name="Object"/>               &nb

Document Workflow Issue

I have started to see some irregualrities in my document workflow setup whereby a user will recieve an email to say they have started the workflow on their dcument that they have uploaded, within this email there is a list of 3 reviewers, but now these reviewers are not being listed, i have looked in the event log and i have loads of event id 3083 which states: The protocol handler Search.Mapi2Handler.1 cannot be loaded. Error description: Class not registered Any ideas?? The event id`s i have seen are 6875, 3083, 1516

crawling sharepoint document library issue



SharePoint document library's minor versions not crawling on clients server.

I have compared all configurations on local and clients server it's same.




Mukesh Ajmera

Document Library issue



I have a document library in my site and in one of the pages im displaying the document library as a webpart(add a webpart and selected the document library) but the items are not coming in the order ,i want to make this items in the ascending order.. document library we can make ascending or descending but in the page its not coming in the order what document library has..please help me...

 Later addition:

i tried by creating site content type but its working fine i mean inside the document library but still its taking the last update\time in the webpart i want to make this webpart with document library in the ascending order.

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

SharePoint Document Workspaces for Developers

Office 2003 is being released this month, and a cast of supporting applications is already available. One of these is Windows SharePoint Services 2.0, the free team add-on for Windows Server 2003. If you're not familiar with SharePoint Services basics, take a look at What Developers Need to Know About Windows SharePoint Services. In this article, I'm going to drill into one key place where SharePoint and Office 2003 overlap: document workspaces

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

SharePoint document migration challenges when migrating files and folders

There are several challenges when migrating documents to Microsoft SharePoint. While these challenges can be overcome, they are a real pain if the migration source, content and file systems are not SharePoint friendly.

IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

xpath issue


Hi i am using xpath to loop through each node,

the xml is below i can get the value of "link" but i cant get the thumbnail value, have you got any ideas how i can do this, my code is below.



     <link>test 1</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />



     <link>test 2</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />


public void FindLinks(XPathNavigator p_xPathNav, DataTable dt)
            //run the XPath query
            XPathNodeIterator xPathIt = p_xPathNav.Select("//item");

            //use the

User validation Issue in xlsx file



I am validating user from Login.xlsx file. It was working fine by validating email and password from that file. For testing i got new file same contents of file but added some more user names.

So after that when i validating the user i am getting the following error "Data type mismatch in criteria expression".

But when i replaced the new to old one it is working fine. The contens of both files are the same. So why this kind of error happened.


Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

Data Truncation issue with Enterprise Library Logging WriteLog stored Proc


Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.


Thanks 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