Avatar of siddhuoops
siddhuoops

asked on 

navigate records in asp.net

Hello experts,

                    I have a webform in aspx using C#. In a table, i have the data for the clients for 12 months. Meaning, if I have a clientABCD, then that ABCD appears in that table for 12 times from Jan to Dec. Now, I would want the user to navigate back and forth the records for the client they select by having simply a previous and Next button. Could I get some ideas on how to do it or are there any tutorials or any samples that can guide me on this.


Thank you in advance.
C#

Avatar of undefined
Last Comment
Gautham Janardhan
Avatar of Gautham Janardhan
Gautham Janardhan

try this it should work but this for win form same with asp.net no much change

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Project1
{
    public partial class Form3 : Form
    {
        DataSet FSet;
        public Form3()
        {
            InitializeComponent();
            FSet = new DataSet();
            FillTable();
            dataGridView1.DataSource =
                FSet.Tables[0];
            textBox1.DataBindings.Add("Text", FSet.Tables[0], "Address");
        }
        void FillTable()
        {
            System.Data.SqlClient.SqlConnection FConnection;
            try
            {

                FConnection =
                    new SqlConnection(
                    @"DATA SOURCE= TERMINAL-01\IRIS;UID= sa;PWD= kl16252;DATABASE= RANDD;");
                SqlCommand FCommand =
                    new SqlCommand(" select * from bangalore ",FConnection);
                SqlDataAdapter FAdapter = new SqlDataAdapter
                (FCommand);
                FAdapter.Fill(FSet);
            }
            catch (Exception)
            {
             
            }
        }
    }
}
Avatar of siddhuoops
siddhuoops

ASKER

Ok! this is to show the data in a gridview but how would I do it when I am using a panel where I have all the textboxes to display the data. I am not using any tools like gridview or detailsview..I might have to have a loop where for previous records, I would have i-- and for next records, I would have i++. But I don't know how to actually write it...
ASKER CERTIFIED SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo