How would i explain this problem. hmmm...

I have a program for the database of the patient's record and I have a different tables which are categorize, like table for personal information , table for gynecological history and so on, each table has the column "NAME" which is for the search purpose where if you search a record it will show the record of the different tables in a one search process that has the same text that is inputted "NAME" .


it explains here when you type on the Nametextbox under the table of Personal information, it will copy the string on there and transfer to the nametextbox of the gynecological and other table of the database. So here the problem starts , i created a button for the update command which is for the edit process, i coded this :


and error provider provide this thing when you click update command:
Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.

please give me some other way or the solution for this.. plsss.

6 Years
Discussion Span
Last Post by adam_k

I don't have enough info to really understand your problem or to comment on a possible solution but I do have a suggestion as to your table design.

I strongly suggest that you create a separate table that contains (minimum) two columns. One column should be the patient's name, the other should be a unique ID. The remaining tables should refer to the patient only by ID. In the event that you have two patients with the same name then a third coolumn should be added to uniquely identify a patient (birth date, address, phone number, etc). It is not a good idea to duplicate information in a database. Let's assume that you have a patient named Joanne Johnson. With your current schema, that name would appear in multiple tables. If you were to acquire a second patient with the same name you would have to modify all of your table structures to distinquish them. Also, If Joanne Johnson changes her last name (marriage, divorce, etc) then you would have to modify all records in all tables that refer to her. However, if you store the name in only one table, only that one table needs to be updated.

Another reason is that a unique ID can be generated in four bytes of storage (more if a GUID is used). A name is typically stored as a varchar and will always require more than four bytes.

A further reason is that my suggested schema divides the patient info between sensitive and non-sensitive. All of the sensitive (medical) data is tagged only with a patient ID, not a patient name.

I am assuming that each table has a name field based on

each table has the column "NAME"

Edited by Reverend Jim: n/a

Votes + Comments
I agree

Reverend is correct. Your design needs some changes.
If you need to search by name in any of the tables that don't have a name then join to the table that has it and you'll be able to.
What happens if you need to search a patient with their social security number or their phone (eg. from caller ID for a missed call).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.