Results 1 to 4 of 4

Thread: alternative to TRIM?? help needed.....

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Posts
    150

    alternative to TRIM?? help needed.....

    Hey guys

    my field is set up in sql as char 100

    although when i pass in a string of say 10 charcters, this is stored in the field as 10 characters followed by 90 spaces, does anyone know why this is??

    I suppose a way of fixing it is by using TRIM but surely there must be an option to sotp this form happening???

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: alternative to TRIM?? help needed.....

    Hi,

    If you have set up your database field to reserve spaces for 100 characters then that is what it will do. Why do you object to using the Trim function when obtaining the data from the database?
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: alternative to TRIM?? help needed.....

    use varchar or nvarchar, instead of char, as your datatype in your SQL table and it will not use all 100 spaces

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Posts
    150

    Re: alternative to TRIM?? help needed.....

    yea thats it working...
    many thanks

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