“/aspppppppppp”应用程序中的服务器错误。
________________________________________
GridView“GridView1”激发了未处理的事件“RowDeleting”。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Web.HttpException: GridView“GridView1”激发了未处理的事件“RowDeleting”。
源错误:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[HttpException (0x80004005): GridView“GridView1”激发了未处理的事件“RowDeleting”。]
System.Web.UI.WebControls.GridView.OnRowDeleting(GridViewDeleteEventArgs e) +2373419
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +621
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +1183
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +201
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9654230
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639
________________________________________
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.6.1055.0
![图片说明](https://img-ask.csdn.net/upload/201611/06/1478415854_458714.jpg)
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage2.master" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
string strCon = "Data Source=localhost;DataBase=information.mdb";
OleDbConnection conn;
OleDbCommand cmd;
//conn = new OleDbConnection(strCon);
protected void Page_Load(object sender, EventArgs e)
{
if (!(Page.IsPostBack))
{
string strSql = "select 姓?名? from [info]";
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_data/information.mdb"));
OleDbDataAdapter da1 = new OleDbDataAdapter(strSql, conn);
DataSet ds1 = new DataSet();
da1.Fill(ds1, "info1");
DropDownList1.DataSource = ds1.Tables["info1"];
DropDownList1.DataTextField = "姓?名?";
DropDownList1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
OleDbConnection conn2 = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_data/information.mdb"));
string str2 = "select 姓?名?,身¦¨ª份¤Y证¡è,房¤?间?号?,押o金e,房¤?费¤? from [info] where 姓?名?=@姓?名?";
OleDbCommand cmd = new OleDbCommand(str2, conn2);
cmd.Parameters.AddWithValue("@姓?名?", DropDownList1.SelectedItem.Text);
OleDbDataAdapter da2 = new OleDbDataAdapter(cmd);
DataSet ds2 = new DataSet();
da2.Fill(ds2, "info");
GridView1.DataSource = ds2.Tables["info"].DefaultView;
GridView1.DataBind();
}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" runat="server"
contentplaceholderid="ContentPlaceHolder1">
<asp:Label ID="Label1" runat="server" Text="退ª?房¤?人¨?姓?名?:êo"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" Height="20px" Width="92px">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="查¨¦询¡¥" />
<asp:GridView ID="GridView1" runat="server" Height="82px" Width="586px"
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
CellPadding="3" GridLines="Vertical"
>
<AlternatingRowStyle BackColor="#DCDCDC" />
<Columns>
<asp:CommandField ShowCancelButton="False" ShowDeleteButton="True" />
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#0000A9" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#000065" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server">
</asp:AccessDataSource>
</asp:Content>