<p>My code for sql connection using linq is:</p>

<pre><code>var query1 = from u in dc.Usage_Computers
          where u.DomainUser == s3
          select u; // selects all feilds from table

GridView1.DataSource = query1;
GridView1.DataBind();
</code></pre>

<p>I have a field called "Operation" in the table "Domainuser" which has values like "1, 2, 3". When I populate these values to data grid I wanted to convert them to meaningful values like if the value of Operation is 1 then display in datagrid as "logon", if 2 then "logoff" etc...</p>

<p>How do i assign values for them after retrieving from database?</p>

I've done something similar using TemplateFields.  Using an ASP:Label bound to the property and adding an OnPreRender event handler for the control.  In the event handler for the control I translate the text based on it's current value and set the new value:
```
```
protected void label_OnPreRender( object sender, EventArgs e )
{
   Label l = (Label)sender;
   switch (l.Text) {
      case "1":
         l.Text = "Logon";
         break;
       ...
      default:
         break;
   }
}
```
```
If the form is in edit mode, you'll need to handle it differently.  You'll also probably need to add handlers for Inserting and Updating to the View control you are using to translate the data supplied by the page into its database representation.