Q:

Create computed column with string in formula

I want to create a computed column in SQL SERVER and set the formula to this
([Category] +  '.aspx?ID=' + [Post_ID])

Not working though......what am i missing? 
Category and Post_ID are current columns in the table

A:

Do you do
SELECT [Category] +  '.aspx?ID=' + [Post_ID]
FROM table

? 
Try
SELECT CAST([Category] AS NVARCHAR(MAX)) + '.aspx?ID=' CAST([Post_ID] AS NVARCHAR(MAX))
FROM table

or specify max size depending on your columns' data type. 

Above answer is bad.  DON'T FORMAT ON DATA LAYER.  FORMAT ON PRESENTATION LAYER, i.e. in mark-up.  E.g.:
<asp:HyperLinkField
    HeaderText="LinkHeader"
    DataNavigateUrlFormatString="{0}.aspx?ID={1}" 
    DataNavigateUrlFields="Category,Post_ID"
    DataTextField="LinkName" />

(to work properly this requires also a field LinkName to exists in the resulting selection)
or
<asp:Hyperlink runat= "server"
    Text='<%# DataBinder. Eval(Container. DataItem, "LinkName").ToString() %>' 
    NavigateUrl='<%# DataBinder. Eval(Container. DataItem, "Category").ToString() + ".aspx?ID=" + DataBinder. Eval(Container. DataItem, "Post_ID").ToString() />   

A:

This actually sorted it out for me at the end.....
NavigateUrl='<%# String. Format("{0}.aspx?ID={1}", DataBinder. Eval(Container. DataItem, "Category"), DataBinder. Eval(Container. DataItem, "Post_ID")) %>'

