Yogesh Vedpathak

Yogesh Vedpathak

  • 681
  • 1.4k
  • 192.5k

Must declare the scalar variable "@ID". Description: An

Oct 23 2016 10:58 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Webform1.aspx.cs" Inherits="aabhdi.Webform1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" DataSourceID="SqlDataSource1" EnableModelValidation="True">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="True" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="NAME" HeaderText="NAME" SortExpression="NAME" />
<asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
<asp:BoundField DataField="MOBILE" HeaderText="MOBILE" SortExpression="MOBILE" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DataConnectionString %>" SelectCommand="SELECT * FROM [ABHIDI]" UpdateCommand="UPDATE [ABHIDI] set [ID]= @ID,[NAME]= @NAME,[EMAIL]= @EMAIL,[MOBILE]= @MOBILE, where [ID]=@ID" DeleteCommand="DELETE From [ABHIDI] Where [ID]=@ID" ></asp:SqlDataSource>
</div>
</form>
</body>
</html>

Answers (3)