Results 1 to 4 of 4

Thread: Why Xquery is converting Vbcrlf to Vblf

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Why Xquery is converting Vbcrlf to Vblf

    <Root>
    <Row>
    <Col2>data</Col2>
    <Col3>data1</Col3>
    <Col4>data3</Col4>
    <Col1>Rowid1</Col1>
    </Row>
    <Row>
    <Col2>data</Col2>
    <Col3>data2</Col3>
    <Col4>data4</Col4>
    <Col1>Rowid2</Col1>
    </Row>
    </Root>

    The above xml is stored in sql server with datatype xml.
    Here data3 is entered by user eg: data3 = A & vbnewline & B.

    Query 1:
    select column from table where [Sl_No]=7203
    Result : A & vbnewline & B

    Query 2:
    select column.value('(/Root/Row[Rowid=''1'']/col4/text())[1]','varchar(max)') from table where [Sl_No]=7203
    Result : A & vblf & B

    All users use windows os.
    why is xquery converting vbnewline(vbcrlf) to vblf?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Why Xquery is converting Vbcrlf to Vblf

    CrLf is specific to Windows as a line break with just Lf being far more common. Your query is likely being cross-platform-friendly. The RichTextBox control removes carriage returns too. A line break should just be considered a line break, regardless of what characters it's composed of.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Why Xquery is converting Vbcrlf to Vblf

    Query 2 giving result A & vblf & B for only some rowid for others it gives A & vbnewline & B.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Why Xquery is converting Vbcrlf to Vblf

    1) Then that's probably what's in there... you'd need to look at the file/data at the binary level to really know, anything else will be an interpretation and may skew what you're seeing.
    2) Is it really an issue? At this point, I feel like you're splitting hairs (newlines)...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width