[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

Navigating through database records in web app

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
RichardFox
Asked:
RichardFox
  • 2
1 Solution
 
chmohanCommented:
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now