Sunday, February 12, 2012

Calumn autocomplete

Hello.
It is possible to set autocomplete(?) for table column. For example I have column nvarchar(10) and I insert to this field value 'test' witch is 4 chars long. If I select, I select 'test' - but I need for example 'aaaaaatest'. Is it possible on sql2005?

Best regards,
Radek

Hi,

Just give you a suggestion, maybe not the easiest one. Caculate the length of the value which gets from database, make a compare with the length of nvarchar and deside how many extra chars should be added.

string value;// The value you stored in databasestring extra_char_value="";// The extra-valueint nvarchar_length=10;// The length of the data fieldint extra_char_length = nvarchar_length -value.Length;for (int i = 0; i < extra_char_length; i++) { extra_char_value +="a"; }value += extra_char_value;
Thanks.

No comments:

Post a Comment