Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

What is wrong with my Gridview

$
0
0

I have a simple gridview with a simple SQLDataSource.  When I click the "EDIT" Button I can change a value in the Grid, But when I Click the "Update" button the changed cell reverts to it's previous value and when I cleck the "Drlrtr" button I get a error -"

Server Error in '/' Application.


Must declare the scalar variable "@EmailID".

 

I've tried numerous variations to my html but none are working.  I think my html (see below) is correct yet it isnot working.  Is this corruption or am I missing something?  Thanks for any Ideas you care to offer........................Phil Hoop

Relevant HTML is inserted

<asp:GridView ID="gvEmail" runat="server" DataSourceID="SqlDataSource3"
                    AllowSorting="True" AutoGenerateColumns="False"
                    EmptyDataText="There are no Email addresses for this message"
                    SkinID="Standard" Width="100%" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" AutoGenerateSelectButton="True"><Columns><asp:BoundField DataField="Email" HeaderText="Email"
                            SortExpression="Email" /><asp:BoundField DataField="LastName" HeaderText="LastName"
                            SortExpression="LastName" /><asp:BoundField DataField="FirstName" HeaderText="FirstName"
                            SortExpression="FirstName" /><asp:BoundField DataField="EmailID" HeaderText="EmailID" InsertVisible="False"
                            ReadOnly="True" SortExpression="EmailID" Visible="True" /></Columns></asp:GridView><asp:SqlDataSource ID="SqlDataSource3" runat="server"
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
        DeleteCommand="DELETE FROM tmpEmailList WHERE [EmailID] = @EmailID"
        SelectCommand="SELECT tmpEmailList.* FROM tmpEmailList"
        UpdateCommand="UPDATE tmpEmailList SET Email = @Email, LastName = @LastName, FirstName = @FirstName  WHERE [EmailID] = @EmailID"><DeleteParameters><asp:Parameter Name="EmailID" Type="Int32"/></DeleteParameters><UpdateParameters><asp:Parameter Name="Email" Type="String" /><asp:Parameter Name="LastName" Type="String" /><asp:Parameter Name="FirstName" Type="String" /><asp:Parameter Name="EmailID" Type="Int32" /></UpdateParameters></asp:SqlDataSource>



Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>