Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 8th, 2004, 02:15 AM
Authorized User
Join Date: Aug 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to macupryk Send a message via Yahoo to macupryk
Default Navigating to another list in a DataList

How to do I navigate to another list in a DataList. I only want one record perpage. I have been searching
for an answer and I have come up with nothing. If anyone has any ideas please share them with me. I would
so apprecitate it.

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Data.Odbc;
using System.Text;

namespace MSPOS
    /// <summary>
    /// Summary description for Objects.
    /// </summary>
    public class Objects : System.Web.UI.Page
        protected System.Web.UI.WebControls.DataList myDataGrid;
        protected System.Web.UI.HtmlControls.HtmlForm Form1;
        private DataSet ddlDataSet1 = new DataSet();
        private DataSet ddlDataSet = new DataSet();
        protected Int32 _currentPageNumber = 1;
        protected int PageSize = 1;
        public void Page_Load ( Object sender, EventArgs e )
            if ( !Page.IsPostBack )

        public void BindData()
            OdbcConnection myConnection = new

            // get records from the table
            string commandString = @"SELECT CM_REF, CM_DESCRIPTION,
            // Set the datagrid's datasource to the datareader and databind
            // Create a OdbcCommand object and assign the connection connect to
the database
            // Create a OdbcCommand object and assign the connection connect to
the database
            OdbcCommand command = myConnection.CreateCommand( );
            command.CommandText = commandString;
            command.Connection = myConnection;
            // Create the Reader and bind it to the datagrid
            OdbcDataReader reader =
command.ExecuteReader(CommandBehavior.CloseConnect ion);


        private void InitializeComponent()
            this.myDataGrid.SelectedIndexChanged += new
System.EventHandler(this.myDataGrid_SelectedIndexC hanged);


        private void MyDataGrid_SelectedIndexChanged(object sender,
System.EventArgs e)


        private void myDataGrid_SelectedIndexChanged(object sender,
System.EventArgs e)


Thank You for Your Time,


Knowledge is to be shared.
Knowledge is to be shared.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in navigating kk2ka4 XSLT 1 November 12th, 2008 01:45 AM
Navigating Recordsets w/out specifying name Tethys Access VBA 7 December 5th, 2005 04:47 PM
navigating a dataset ranakdinesh BOOK: Professional C#, 2nd and 3rd Editions 4 June 1st, 2004 11:37 PM
Navigating between Forms rakeshgnair Access VBA 1 May 21st, 2004 11:28 PM
Navigating thru DataGrid Object chiefouko VB Databases Basics 0 July 24th, 2003 04:56 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.