Results 1 to 3 of 3

Thread: Square character in database table *Resolved *

  1. #1

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Square character in database table *Resolved *

    Hi all, I have a SQL Server 2000 database that has a table in it called
    Person. One of the attributes is the persons address which is populated via
    a VB.Net application.

    A user is able to enter as up to four lines as their address in a text field
    in the VB app. This information is then inserted into the SQL table via a
    stored procedure.

    I replace the line feed characters in the address before I send the Insert
    string to the stored procedure.

    My problem is that when I view the table with the addresses in it, whilst
    the line feed characters have in fact been replaced there is also a little
    square box (Unicode character) which has been inserted.

    This little character is causing my application a few problems, so, how can
    I get rid of it and also, why is it getting placed there in the first
    place??

    Thanks alot for any help
    Cheers
    Markus
    Last edited by MarkusJ_NZ; Jun 5th, 2003 at 12:48 AM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Chances are it is the carriage return character (ascii code 13). A multi-line text box adds the ascii codes 13 (carriage return = vbCR) and 10 (LineFeed = vbLF) when the user hits the enter key.

    You mentioned that you replace the line feeds. It sounds like you want to replace the carriage returns and linefeeds, use the vbCRLF constant or the vbNewLine constant.

    strData = Replace(txtData.Text,vbNewLine," ")

  3. #3

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Thanks for that, I was just replacing the line feed using chr(10). I changed the code to replace vbCrLF and it's working now (No unicode characters)

    Thanks again
    Mark

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