473,396 Members | 1,996 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.

iterating and comparing rows

Hi!
i am working on a hospital data base. i have two tables Administration
and knowlege base.
in Administration i have columns ID, NumberOfDoctors etc, and in
KnowlegeBase i have some similar columns but ofcourse differnet data.

Administration
ID Date HospitalName
NumberOfDoctors .........................
71 4/6/2007 Children Hospital
378 .........................
153 4/19/2007 MH 600
207 4/20/2007 Our Hospital 100
227 4/15/2007 My Hospital 30
313 4/11/2007 Hospita 150
576 4/17/2007 Health Ways 80

KnowlegeBase
ID NumberOfDoctors NumberOfBeds
AvgPatPerDoc .....................
1 378
1500 20 ...........

I now want to compare and iterate through the rows of
Administration.NumberOfDoctors with KnowlegeBase.NumberOfDoctors..
and i dont know how to do it.
Got me??

(using sql server2005 and c#)

Mar 30 '07 #1
2 1329
On 30 Mar, 11:25, "Shum" <shumy...@gmail.comwrote:
Hi!
i am working on a hospital data base. i have two tables Administration
and knowlege base.
in Administration i have columns ID, NumberOfDoctors etc, and in
KnowlegeBase i have some similar columns but ofcourse differnet data.

Administration
ID Date HospitalName
NumberOfDoctors .........................
71 4/6/2007 Children Hospital
378 .........................
153 4/19/2007 MH 600
207 4/20/2007 Our Hospital 100
227 4/15/2007 My Hospital 30
313 4/11/2007 Hospita 150
576 4/17/2007 Health Ways 80

KnowlegeBase
ID NumberOfDoctors NumberOfBeds
AvgPatPerDoc .....................
1 378
1500 20 ...........

I now want to compare and iterate through the rows of
Administration.NumberOfDoctors with KnowlegeBase.NumberOfDoctors..
and i dont know how to do it.
Got me??

(using sql server2005 and c#)
It's not clear what you're trying to achieve or how the two tables
relate. But isn't this more of a SQL issue? For example if
knowledgebase has a foreign key to hospital, or knowledgebase.ID maps
directly to administration.id, why not create a view which joins the
two tables and load that into a dataset? If you're only interested in
differences, you could filter out matches in the view rather than
bring all the data over. Are there aggregates?

Mar 30 '07 #2
The thing is that i want to compare the records of
administration.numberofdoc with knowlegebase.numberofdocs... knowlege
base has all the facts and actual figures whereas other other tables
dont.. so the records of thosse tables needs to be compared. wud do
that with if staements etc.... I thinkk that could be achieved through
dataset.. will work on it tonight..

Mar 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Derek | last post by:
Pardon the newbie question, but how can I iterate over blocks of data from a binary file (i.e., I can't just iterate over lines, because there may be no end-of-line delimiters at all). Essentially...
0
by: laxmiuk | last post by:
I've original version of a table called PMM (Product Material Master). Thro' a web interface, user can change that table contents. Once changed, i need to raise an ECN (Engineering CHange Note)...
4
by: lasmit | last post by:
I am updating a C# web project which stores the contents of an ASP web form in an SQL Server 2000 database. Originally the code deleted all the current contents of the database and then...
14
by: Jacko | last post by:
Hi guys, Say I made a SELECT statement to my sql DB that would return 50 rows that I will use a sqldatareader to access. Instead of iterating through each and every row of the datareader, I'd...
19
by: Will Lastname | last post by:
In one of the applications that I'm working on I have 2 sets of functions that build different datasets. Imagine 4 columns in a datagrid. Inside those 4 columns I have nested datalists. Two of...
10
by: Ken Foster | last post by:
I have a hashtable keyed by some name, holding an instance of an object. Most of the time I use the hashtable in the traditional sense, given a name, I lookup the object, then I run a method on...
1
by: Will Chamberlain | last post by:
I just created an application that displays data from 2 sources in a datagrid. There are 2 repeaters nested in the datagrid (probably not the best idea). The whole purpose of this application is to...
4
by: Frank | last post by:
Hello, Developing an app where the user fills out a sometimes quite lengthy form of chkboxes, txtboxes, radbtns, etc. User responses are saved to a mySql db, which the user can later edit. When...
5
by: Frank | last post by:
Hello All, I am working on a vb.net app where I need to compare to 2 datatables and determine if a string exists in one or both. The first dt is filled from the db. A form is loaded and the...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.