Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


    Error: Must declare the scalar variable "@email"

    avatar
    jeliey
    Ahli Baharu
    Ahli Baharu


    Number of posts : 26
    Registration date : 01/04/2009

    Error: Must declare the scalar variable "@email" Empty Error: Must declare the scalar variable "@email"

    Post by jeliey Wed Oct 07, 2009 10:50 am

    Please guys, help me solving dis prob...when run the proj,got the error: Must declare the scalar variable "@email"...so frustrating...here goes my code

    <table border="0" width="750">
    <tr>
    <td valign="top" style="width: 369px">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="true" AutoGenerateColumns="false" DataKeyNames="CartID" DataSourceID="SqlDataSource1" Width="370px" ForeColor="Black">
    <Columns>
    <asp:BoundField DataField="email" HeaderText="Email" ><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
    <asp:BoundField DataField="firstname" HeaderText="First Name" SortExpression="firstname" ><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
    <asp:BoundField DataField ="lastname" HeaderText="Last Name"><HeaderStyle HorizontalAlign ="Left" /></asp:BoundField>
    <asp:CommandField ShowSelectButton="True" ><ItemStyle Width="50px" /></asp:CommandField>
    </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    SelectCommand="SELECT [Cart.CartID],[Cart.ProdID],[Cart.email],[Cart.ProdName],[Cart.ProdPrice],[Cart.Quantity],[Cart.Total]
    FROM [Cart] INNER JOIN [Customers] ON (Customers.email=@email)">
    </asp:SqlDataSource>
    </td>
    <td valign="top">
    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="CartID" Width="373px">
    <EmptyDataTemplate >
    Please select a customer<br /><br />
    </EmptyDataTemplate>
    <ItemTemplate >
    <asp:Label ID="Label1" runat="server" Text="Cart ID:" Width="100px"></asp:Label>
    <asp:TextBox ID="txtCartID" runat="server" ReadOnly="True" Width="200px" Text='<%# Eval("CartID") %>' ></asp:TextBox>

    <asp:Label ID="Label2" runat="server" Text="Product ID:" Width="100px"></asp:Label>
    <asp:TextBox ID="txtProdID" runat="server" ReadOnly="True" Width="200px" Text='<%# Eval ("ProdID") %>'></asp:TextBox>

    <asp:Label ID="Label3" runat="server" Text="Product Name:" Width="100px"></asp:Label>
    <asp:TextBox ID="txtProdName" runat="server" ReadOnly="true" Width="200px" Text='<%# Eval("ProdName") %>'></asp:TextBox>

    <asp:Label ID="Label4" runat="server" Text="Product Price:" Width="100px"></asp:Label>
    <asp:TextBox ID="txtProdPrice" runat="server" ReadOnly="true" Width="200px" Text='<%# Eval ("ProdPrice","{0:C}") %>'></asp:TextBox>

    <asp:Label ID="Label5" runat="server" Text="Quantity:" Width="100px"></asp:Label>
    <asp:TextBox ID="txtQuantity" runat="server" ReadOnly="true" Width="200px" Text='<%# Eval("Quantity") %>'></asp:TextBox>

    <asp:Label ID="Label6" runat="server" Text="Total:" Width="100px"></asp:Label>
    <asp:TextBox ID="txtTotal" runat="server" ReadOnly="true" Width="200px" Text='<%# Eval("Total","{0:C}") %>'></asp:TextBox>

    </ItemTemplate>
    </asp:FormView>
    &nbsp;
    </td>
    </tr>
    </table>

      Current date/time is Fri Apr 19, 2024 1:05 pm