smeagol,
If you need the padding, then why not define the field as a char field?
This way, you always get the padding.
You could always call the sp_columns stored procedure (once), and get
the length of the field from that (you can store it as well, since your
schema should not change during the course of execution) and pad
appropriately.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"smeagol" <pedorro77.hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have a varchar 255 field in the Sql.
When i get the data with (string)myReader["buffer"];
it's trimed
ie(
SQL : "qwerty " (Lenght 255)
c# : (string)myReader["buffer"].Lenght; (=5)
It's possible to get
(string)myReader["buffer"].Lenght; (=255)
Of course a trick is to use PADL with SPACE
But anyway to do it wihout PADL?
Thanks,