Hi guys,, im having problem with my stored procedure. i dont know how to make it show..when i click on a particular record on my datagridview it should display another form with its corresponding laboratory records, radiology records and so on..


here is my code

ALTER PROCEDURE dbo.ViewAllLabRecords
(
@lab_Record_ID int
)
AS
 SELECT * FROM Laboratory_Records LR JOIN PT_Chart PTC
 ON LR.Lab_Record_ID = PTC.Lab_Record_ID
 WHERE LR.Lab_Record_ID = @Lab_Record_ID;

pls help me solve this one

Recommended Answers

Need more info to help you.

How the datagridview gets populated ?

What exactly you want to show ?

Jump to Post

All 4 Replies

Need more info to help you.

How the datagridview gets populated ?

What exactly you want to show ?

So you want to populate the second grid based on the row you select in the first grid , right,

1. Capture the PK of the 1st table (when you select the row on the 1st grid)
ex--patient id

2. Use the same value to fetch data from the 2nd table, by using in the where clause.

Populate the send grid with the retrieved recordset / dataset.

no ahm the listview at the bottom is for my search displays.. what i want is when i click the view selected patient chart it will display another form and show the laboratory records


can you give me sample codes?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.