views:

29

answers:

1

Hi all,

Below is my query which is in Storedprocedure(SQL Server 2008) will return list of items from a table.

Query:

SELECT 
( COALESCE(ReviewDescription,'')+ REPLICATE (' ', 20 - LEN(ReviewDescription))
+ '|' + 
( CONVERT(VARCHAR(100),ReviewCharge))) AS ReviewTypes
FROM ReviewType

query result(copied to text pad then its looking like below):

Sample review type    |200

But after binding to ASP drop down control it is displaying like below drop down display:

Sample review type|200

Please some one can help on this.

Thanks in advance...

+2  A: 

It sounds like it could well just be the browser collapsing whitespace. Look in the HTML source to see what's actually being sent down. Then you can determine whether it's a problem in the display or the data access.

(I'm not sure this is really a good way of displaying a pseudo-table in a drop-down, to be honest.)

Jon Skeet
I verified in View Source of HTML it is displaying fine but in the Drop Down same issue. I think it is not a Browser issue also, if it is it should remove the spaces between the words.
VinnaKanna
@VinnaKanna: Okay, so you need to work out the appropriate HTML to display. (In other words, this is really not HTML problem, rather than one in C# or SQL.) You can experiment with that with a simple text editor and a static HTML file. For example, you might try using ` ` instead of each space. I'm still not sure it'll look nice, but it might do what you need.
Jon Skeet