Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Whitespace in Form Control

Whitespace in Form Control

Scheduled Pinned Locked Moved C#
databasehelpcsharpsql-serversysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shafiullah123
    wrote on last edited by
    #1

    Hi Folks, I made a test app with sql server 2008 and vc# 2008. Used dataset, bindingsource, table adapter, bindingnaviagator When i am displaying data on the form in textbox, combobox, text area i found that the data is added with extra whitespace upto the width of the column in table. if my db column size is char(30), and it actually has a value of 10 chars...when i retrieve record it displays 10chars +20whitespace on text box and the text goes hidden to left side in textbox etc.... Is there a way to fix this????????? Coz i am using bindingsource and tableadapter i cant handle it at db level trimming....pls help.....These whitespaces are really irritating....... regards shafi

    T S 2 Replies Last reply
    0
    • S shafiullah123

      Hi Folks, I made a test app with sql server 2008 and vc# 2008. Used dataset, bindingsource, table adapter, bindingnaviagator When i am displaying data on the form in textbox, combobox, text area i found that the data is added with extra whitespace upto the width of the column in table. if my db column size is char(30), and it actually has a value of 10 chars...when i retrieve record it displays 10chars +20whitespace on text box and the text goes hidden to left side in textbox etc.... Is there a way to fix this????????? Coz i am using bindingsource and tableadapter i cant handle it at db level trimming....pls help.....These whitespaces are really irritating....... regards shafi

      T Offline
      T Offline
      tech603
      wrote on last edited by
      #2

      You could trim your string before entering into the database, example: string str = "my blank spaces "; str = str.Trim(); This will trim all whitespace from front or back of the string. Hope that helps.

      Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com

      1 Reply Last reply
      0
      • S shafiullah123

        Hi Folks, I made a test app with sql server 2008 and vc# 2008. Used dataset, bindingsource, table adapter, bindingnaviagator When i am displaying data on the form in textbox, combobox, text area i found that the data is added with extra whitespace upto the width of the column in table. if my db column size is char(30), and it actually has a value of 10 chars...when i retrieve record it displays 10chars +20whitespace on text box and the text goes hidden to left side in textbox etc.... Is there a way to fix this????????? Coz i am using bindingsource and tableadapter i cant handle it at db level trimming....pls help.....These whitespaces are really irritating....... regards shafi

        S Offline
        S Offline
        shafiullah123
        wrote on last edited by
        #3

        Hi there, Trim() i used ...... Its the first time...........like a form with a binding navigator directly picking db values. we use trim when we are sending the records to db........ Using binding navigator it calls a Fill() function on tableadapter..and retrieves records from dataset Is there a way to edit default fill query in C#....I think if i can edit the default query i can add DB Trim function and my problem will be solved........Can anybody know how to edit Fill query of a binding navigator or dataset pls help

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups