Additional space inserted with column values

  • I have been using .net 2 with sql compact edition 3. When I changed to windows 7 with .net 3.5

    mdf created with column values (fields) inserted with additional spalces. Eg. Field Employee code will have number 101 but with additional space so that when I search for emp code where empcode =101 it will not return any values. Can someone help

  • It may happened due to migration. but the reason is still weird. you may go with Trim() function as a immediate solution. and try to insert new records and check still the col. gets extra spaces.

  • If the column holds numeric data only the best way to deal with it is to use a numeric data type.

    Based on what I know the engine (even with Compact Edition although I'm not an expert) should trim any trailing spaces when doing a comparison. Are you doing the comparison with SQL or in .NET once you've loaded the data?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply