473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# : optimal dataretrieval.

Airslash
221 100+
Hello,

I'm working on a database application to retrieve and manipulate data from the database. Currently I'm retrieving information about persons and dispay that in a combobox by using a custom class I wrote. Basicly it's just a container that has all the information about a person and a to string method to display it in the combobox.

Now I'm looking for a way that allows me to retrieve the information from a Person fast and clean so I can display it. I've been using custom written DAO objects, but they were slow.

I also need to mention, that the table Person contains links to Country, Status, Category and other related tables. So that information should be accessible as well, because I would like to display Country: England for example instead of Country : 3.
Nov 21 '07 #1
1 942
dip_developer
648 Expert 512MB
Hello,

I'm working on a database application to retrieve and manipulate data from the database. Currently I'm retrieving information about persons and dispay that in a combobox by using a custom class I wrote. Basicly it's just a container that has all the information about a person and a to string method to display it in the combobox.

Now I'm looking for a way that allows me to retrieve the information from a Person fast and clean so I can display it. I've been using custom written DAO objects, but they were slow.

I also need to mention, that the table Person contains links to Country, Status, Category and other related tables. So that information should be accessible as well, because I would like to display Country: England for example instead of Country : 3.
1.first make a sql query joining all your tables and retrieve the information you want.....
2.create a Dataset with those records....
3.now bind the Dataset with the combobox .....
4.set the DisplayMember property to the Person_Name column.....
5.now in the SelectedIndexChanged event of that combo you can have the full information of the selected person....you will have to Typecast the "SelectedItem row" of combo to DataRowView.........the code will look like

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. string person_name = ((DataRowView)myCombobox.SelectedItem).Row("Person_Name");
  4. }
  5.  
  6.  
Nov 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Thomas | last post by:
Hi! How can i get the optimal richtext width size, when depending on the variable text lengh. The text can be colored or with some differnt fontsizes. I dont want use scrollbars. Is there a...
2
by: Gary | last post by:
I am working with a report generator that is based on SQL Server 2000 and uses ASP as the UI. Basically we have a set of reports that end users can execute through a web browser. In general the...
10
by: Tom | last post by:
Hi I am looking for an optimal data-structure in order to replace a map<int,float>. I use it as some kind of sparse array representation. The facts: - the population in the data-structures...
25
by: Johan Bergman | last post by:
Hi, Maybe someone can help me to optimize this C/C++ implementation of a FIR filter (although I realize that I should probably consider an FFT approach instead.) The example below calculates...
3
by: Amy L. | last post by:
Is there a Buffer size that is optimial based on the framework or OS that is optimal when working with chunks of data? Also, is there a point where the buffer size might not be optimal (too...
4
by: Joe Lester | last post by:
I'm trying to figure out what the optimal Postgres configuration would be for my server (with 200 connecting clients, even though I'd really like to get it up to 500). I've got a 700 MHz eMac...
11
by: Mahesh S | last post by:
Hi I recently wrote a user defined function in SQl to run in db2 and it works fine. But I seem to get a warning saying that the performance is sub-optimal. Here is the warning message: ...
1
by: khipro | last post by:
Here i have coded algorithm for Optimal Binary Search Tree but not getting correct result can anybody help me (it is executing but result is not desired)? #include<iostream> using std::cin;...
1
by: Rudolf Bargholz | last post by:
Hi, We have created triggers to log modifications to tables in our application. The triggers work fine, just on one of the tables in our database the triggers fail with the error message...
1
by: almurph | last post by:
Folks, I want to modify the Needleman Wunsch algorithm (pseudo-code here: http://en.wikipedia.org/wiki/Needleman-Wunsch_algorithm) so that it produces more than the optimal solution. What I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.