Code or xml request in asp.net showing invalid check in or checkerror.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arun Palanichamy
    New Member
    • Sep 2010
    • 2

    Code or xml request in asp.net showing invalid check in or checkerror.

    Code or xml request in asp.net showing invalid check in or checkerror.
    Code:
      str4 = str4 + "<CheckIn>" + objHotelHandlerELL.CheckInDate.Year.ToString().Trim() + "-" + objHotelHandlerELL.CheckInDate.Month.ToString().Trim() + "-" + objHotelHandlerELL.CheckInDate.Day.ToString().Trim() + "</CheckIn>";
                strRequest = ((str4 + "<CheckOut>" + objHotelHandlerELL.CheckOutDate.Year.ToString().Trim() + "-" + objHotelHandlerELL.CheckOutDate.Month.ToString().Trim() + "-" + objHotelHandlerELL.CheckOutDate.Day.ToString().Trim() + "</CheckOut>") + "<Currency>USD</Currency>") + "<RateType>breakdown</RateType>" + "<Rooms>";
    [imgnothumb]http://bytes.com/attachments/attachment/3937d1284789831/request-
    shot.jpg[/imgnothumb]
    [imgnothumb]http://bytes.com/attachments/attachment/3938d1284789831/error-shot.jpg[/imgnothumb]
    Attached Files
    Last edited by Frinavale; Sep 20 '10, 01:57 PM. Reason: Added the question/problem to the thread and also added the images that show what the problem is.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    XML is validated against something called a Document Type Definition (DTD). If your XML markup doesn't match the description of how the XML should be formatted you will experience errors.

    The best way to avoid this problem is to use the tools available in .NET for working with XML. Most of these tools are found in the System.XML Namespace or you could consider using LINQ to XML.

    -Frinny

    Comment

    • Arun Palanichamy
      New Member
      • Sep 2010
      • 2

      #3
      XML Response Convertion Code

      Hi thanks a lot to your reply. and i have one more doubt. can you send the sample code for converting XML response to data set?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        You could use the DataSet.ReadXml method....

        eg:
        (VB.NET)
        Code:
        Dim url = "http://localhost/ABC.aspx"
        Dim reader As New System.Xml.XmlTextReader(url)
        Dim ds As New DataSet()
        ds.ReadXml(reader)
        -Frinny

        Comment

        Working...