如何从DataSet将数据绑定到gridview。 [英] How to bind data to gridview from DataSet.
本文介绍了如何从DataSet将数据绑定到gridview。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用下一个上一个功能从DataSet将数据绑定到gridview,而不在DataBase上重复点击。
How to bind data to gridview from DataSet with Next Previous Functionality without Repeated hits on DataBase.
推荐答案
尝试这个
< br $> b $ b
http:/ /www.aspdotnet-suresh.com/2011/03/gridview-with-custom-paging.html [ ^ ]
http://www.c-sharpcorner.com/UploadFile/rohatash/gridview-paging-sample-in -Asp-Net / [ ^ ]
GridView自定义分页 [ ^ ]
try this one
http://www.aspdotnet-suresh.com/2011/03/gridview-with-custom-paging.html[^]
http://www.c-sharpcorner.com/UploadFile/rohatash/gridview-paging-sample-in-Asp-Net/[^]
GridView Custom Paging[^]
<asp:gridview id="GridView1" runat="server" xmlns:asp="#unknown" />
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string connectionString = "server=SYS2;" + "integrated security=SSPI;" +
"database=ERPFinAccounting";
SqlConnection myConnection;
string str_Account_Select = "SELECT * FROM AccountsTable";
SqlCommand myCommand;
DataSet myDataSet;
myConnection = new SqlConnection(connectionString);
myConnection.Open();
myCommand = new SqlCommand(str_Account_Select, myConnection);
SqlDataAdapter mySQLDataAdapter;
myDataSet = new DataSet();
mySQLDataAdapter = new SqlDataAdapter(myCommand);
mySQLDataAdapter.Fill(myDataSet, "AccountsTable");
GridView1.DataSource = myDataSet;
GridView1.DataBind();
}
}
这篇关于如何从DataSet将数据绑定到gridview。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文