Wednesday, March 7, 2012

Hard coding colum names in returned DetailsView table

Hi all,

We're selecting data from our database, FirstName, LastName, MobileNumber etc.

We're using the detaials view function to return it in a table upon selection. However all of the variables are returned as they are in the database, ie:without spaces.

We tried putting in spaces by selecting "AS what ever", but MSSQL does not seem to like spaces.

Any ideas?

Thanks

Hey,

Are you trying to make the column names have spaces, or the data/ If the first, try using:

AS "First Name"

OR

AS [First Name]

|||

You can rename the columns like this:

SELECT PhoneNumber AS [Phone Number]
FROM TestTable

No comments:

Post a Comment