.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Paging in grid view

Posted By: Naresh     Posted Date: March 08, 2010    Points:2   Category :VB.Net
Hi,

I want to do paging in grid view in vb.net.

Responses
Author: Lalij Mer             
Posted Date: March 08, 2010     Points: 5   

Use this code sample


Public Sub bindgrd()
Dim conn As New SqlConnection()

conn.ConnectionString = ConfigurationManager.ConnectionStrings("cn").ConnectionString.ToString()

conn.Open()

Q = "select * from tablename"

adp = New SqlDataAdapter(Q, conn)

ds = New DataSet()

adp.Fill(ds, "tablename")

Gridview1.DataSource = ds.Tables("tablename")

Gridview1.DataBind()


End Sub

Protected Sub Gridview1_PageIndexChanging(sender As Object, e As GridViewPageEventArgs)
Gridview1.PageIndex = e.NewPageIndex

bindgrd()

End Sub


more details
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.allowpaging.aspx

http://www.developerfusion.com/article/5292/datagridgridview-paging-and-sorting-using-a-datareader/6/

http://geekswithblogs.net/aghausman/archive/2009/05/18/custom-paging-in-grid-view.aspx

Please Check my answer if you help....
Thank You...

Lalit.
Author: Sagar Pardeshi             
Posted Date: April 02, 2010     Points: 5   


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend