I'm using Visual Studio 2010, and that i produced a website (.aspx).

I've an sql database (.mdf file) and I wish to retrieve Just one value on the table and multiply it having a specific number. I have tried personally SqlDataSource and formview with this, and things are ok, I've my number in the formview but how do you multiply the dpi having a variable??

my code is:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="apodeiksi.aspx.cs" Gets="apodeiksi" %>

<%@ Register set up="System.Web.Entity, Version=3.5.., Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Αποδειξη </title>
     <link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>

    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" 
        EnableModelValidation="True" Height="23px" Width="70px" 
                    onpageindexchanging="FormView1_PageIndexChanging">
        <EditItemTemplate>
            PRICE:
            <asp:TextBox ID="PRICETextBox" runat="server" 
                Text='<%# Bind("PRICE", "{0}") %>' TextMode='<%# Eval("PRICE") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            PRICE:
            <asp:TextBox ID="PRICETextBox" runat="server" Text='<%# Bind("PRICE") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            PRICE:
            <asp:Label ID="PRICELabel" runat="server" Text='<%# Bind("PRICE") %>' />
            <br />

        </ItemTemplate>
    </asp:FormView>
                </td><br /></td></tr>
    <asp:Label ID="Label6" runat="server" Text='<%# Bind("PRICE") %>'></asp:Label>
    </table>
<p>
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT [PRICE] FROM [Flight] WHERE ([ID] = @ID)">
        <SelectParameters>
            <asp:SessionParameter Name="ID" SessionField="kratisi" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:Button ID="Button1" runat="server" Text="Button" />

    </p>




</body>

Thanks!

You may create some presentation assistant class such as this:

public static class UiHelper
{
    public static string MultiplyValue(object value, int multiplier)
    {
        return (((int)value)*multiplier).ToString();
    }
}

And compared to your aspx rather than

<%# Eval("PRICE") %>

use

 <%# UiHelper.MultiplyValue(Eval("PRICE"), 5) %>

You can also create any techniques and format any value from database as you would like.