还是报错!

swordmanli swordmanli 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Data.SqlClient.SqlConnection sqlConnection1;
protected WebApplication2.DataSet1 dataSet11;
protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;
protected System.Data.SqlClient.SqlCommand sqlInsertCommand1;
protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

private void Button1_Click(object sender, System.EventArgs e)
{
sqlConnection1.Open();

sqlDataAdapter1.Fill(dataSet11);

DataGrid1.DataSource = dataSet11;
DataGrid1.DataBind();

}

private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
if(e.NewPageIndex>-1 && e.NewPageIndex<this.DataGrid1.PageCount)
{
DataGrid1.CurrentPageIndex=e.NewPageIndex;
}
else
DataGrid1.CurrentPageIndex=0;
TextBox1.Text = DataGrid1.CurrentPageIndex.ToString();
DataGrid1.DataBind();

}
...全文
评论 3
收藏 已收藏
分享
返回顶部
swordmanli
.NET社区 62,275 成员 668,968 内容