<SCRIPT language=VB runat="server">
Sub Page_Load(sender As Object, e As EventArgs) BindGrid End Sub
Sub MyDataGrid_Page(sender As Object, e As DataGridPageChangedEventArgs) dim startIndex as Integer startIndex = MyDataGrid.CurrentPageIndex * MyDataGrid.PageSize MyDataGrid.CurrentPageIndex = e.NewPageIndex
BindGrid ShowStats End Sub
Sub BindGrid()
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("DSN_pubs")) dim ds as DataSet = new DataSet() dim adapter as SqlDataAdapter = new SqlDataAdapter("Select * from Authors", myConnection) adapter.Fill(ds,"Authors")
MyDataGrid.DataSource=ds.Tables("Authors").DefaultView MyDataGrid.DataBind() ShowStats
End Sub
Sub PagerButtonClick(sender As Object, e As EventArgs) 'used by external paging UI Dim arg As string = sender.CommandArgument
Select arg Case "next": If (MyDataGrid.CurrentPageIndex < (MyDataGrid.PageCount - 1)) Then MyDataGrid.CurrentPageIndex += 1 End If Case "prev": If (MyDataGrid.CurrentPageIndex > 0) Then MyDataGrid.CurrentPageIndex -= 1 End If Case "last": MyDataGrid.CurrentPageIndex = (MyDataGrid.PageCount - 1) Case Else: 'page number MyDataGrid.CurrentPageIndex = System.Convert.ToInt32(arg) End Select BindGrid ShowStats End Sub
Sub ShowStats() lblCurrentIndex.Text = "CurrentPageIndex is " & MyDataGrid.CurrentPageIndex lblPageCount.Text = "PageCount is " & MyDataGrid.PageCount End Sub </SCRIPT>
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP.NET Code Articles More By aspfree developerWorks - FREE Tools! | This demonstration gives you an overview of IBM® Rational® Build Forge Express Edition, a global offering that provides a framework to automate and execute software processes. Rational Build Forge provides a software assembly line that can support all of your tools, technologies, and platforms so you can achieve a repeatable, reliable, and traceable build and release process. FREE! Go There Now!
| | | | XML has become a common way of storing business data as flat files and many data server vendors including IBM have provided ways to store this data within relational database systems. Increasingly collections of XML files are accessed like databases using an xQuery and other XML standard mechanisms. Businesses find the need to combine the traditional tabular structured data with XML formatted data. In this webcast, you’ll learn about IBM’s WebSphere Federation Server technology, which provides users with the ability to integrate these two data formats. FREE! Go There Now!
| | | | Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications. FREE! Go There Now!
| | | | Learn field-tested SOA principles, methodology, technology and implementation from the global SOA market leader - in a new e-book by an IBM SOA expert. Written by IBM Certified SOA Solution Designer Bobby Woolf, "Exploring IBM SOA Technology & Practice" is the ultimate insider's guide to SOA - a PDF e-book packed cover to cover with IBM's specific advice on how to make your SOA implementation a success. FREE! Go There Now!
| | | | User communities play an important role in communication and collaboration around products, solutions and other areas of special interest to members. Successful communities are able to provide the right mix of content and services to deliver a value proposition that resonates with each audience. Join Tom Inman, VP of Marketing for Information and Platform Solutions as he introduces the new LeverageINFORMATION community. During this webcast, learn about the value provided by the community and how customers and partners derive value from the community in addressing their own technical and business challenges. FREE! Go There Now!
| | | | Visit IBM developerWorks to download a free trial of the Rational Host Access Transformation Services (HATS) Toolkit. The HATS toolkit provides a set of plug-ins for the IBM Rational Software Delivery Platform to help you easily extend your legacy applications. HATS makes your 3270 and 5250 applications available as HTML through the most popular Web browsers, while converting your host screens to a Web look and feel and it also enables you to develop new Web, portal, and rich-client applications. FREE! Go There Now!
| | | | Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available. FREE! Go There Now!
| | | | You probably have thousands of lines of COBOL code loaded with business intelligence and being used to run your business, along with an army of developers maintaining these applications. Learn how to prepare your applications and developers so you can keep that competitive edge and move to a service-oriented architecture with the IBM Rational Enterprise Modernization solutions. Replay is available for 9 months. FREE! Go There Now!
| | | | Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
| | | | As organizations integrate software into every aspect of business, they are constantly pressured to deliver faster, better, and cheaper results. Unfortunately, a “dis-integrated” software delivery approach reduces returns while increasing costs. This IBM Rational White Paper shows how Integrated Requirements Management aligns organizations around maximizing value and keeping pace with change. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |