Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Navigating through database records in web app

Posted on 2004-08-24
2
258 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

837 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