单击时按钮的事件处理程序出现此错误。请帮我。提前谢谢!
HTMLCODE
<asp:Button ID="RunButton" runat="server" Text="Run" onclick="Load"/>
服务器代码
protected void btn_Click(object sender, EventArgs e)
{
string strConnString = ConfigurationManager.ConnectionStrings["SQL"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand("SELECT * FROM [dbo].[Emp]"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
ResultPage.GridView1.DataSource = dt;
ResultPage.GridView1.DataBind();
}
}
}
}
}