-1

I have a problem.. When I recup the information in my database, I have a lot of blanks after my word because the size in the cells is 10 and I have a word with a size of 3 (example: "abc" and I recup the world "abc ").

Thanks !

Al Kural
  • 1
  • 2

1 Answers1

1

The problem is that you are saving text data in fix length data types like char. Try to use a variable length datatype like nvarchar. You can also use trim functions to remove spaces in the select like

select LTRIM(RTRIM(myColumn)) from myTable

You can also remove the spaces after the database layer, with c# String.Trim function like this: "my string ".Trim();

aperezfals
  • 1,341
  • 1
  • 10
  • 26