Solved

Navigating through database records in web app

Posted on 2004-08-24
2
251 Views
Last Modified: 2010-04-15
I have a local database, and already connect to it and display records in a list box

                  String strConn = ConfigurationSettings.AppSettings["TESTDMS"];
                  String compSql = "SELECT DISTINCT companyname from company ORDER BY companyname";
                  SqlConnection oConn = new SqlConnection(strConn);

                  SqlCommand oCmd = new SqlCommand(compSql, oConn);

                  oConn.Open();
                  companyLB.DataSource = oCmd.ExecuteReader(); // companyLB is a listbox
                  companyLB.DataTextField = "companyname";
                  companyLB.DataValueField = "companyname";
                  companyLB.DataBind();
                  oConn.Close();

I have another table, investEvent, and I want to provide a way of browsing this table, READ-ONLY, with '<<', '<', '>', '>>' buttons. Updating, deleting, and inserting is NOT necessary. I am a little confused by the many data controls and am not sure the simplest, cleanest way to do this. Can I get some suggestions, pointer to articles? Thanks
0
Comment
Question by:RichardFox
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
chmohan earned 500 total points
ID: 11885920
use a   datatable  and navigate the datarows depending on whcih button you click:)
why dont u use  2  listboxes,one to load all the rows,and when he click the button navigate to the record:) the listbox will have a selectedindex and item array,you can navigate using those





0
 
LVL 1

Expert Comment

by:chmohan
ID: 11886275
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now