I have a tricky situation that I just cannot seem to figure out. I'm using ASP.NET 4.0. I have two databases (let's call them Northwind and MyDatabase for simplicity). I cannot modify the data in Northwind, but once I save a copy to MyDatabase, I can change it.
I have a GridView that shows all the tests associated with a patient. I first populate the GridView, retrieving all the tests in Northwind.Test that are associated to a PatientID. On a button click event, I need to:
- Create a new Patient record in MyDatabase.Patient (I've got this part done already).
- Use that newly created PatientID and INSERT all of the rows from the GridView into MyDatabase.Test. I have the PatientID available, I just don't know how to retrieve the data from the GridView.
- (Ideally) I would like to then be able to load that patient record in the future from MyDatabase and be able to UPDATE the tests in the GridView to MyDatabase.Test.
I can load the tests into the GridView no problem. But I have no idea how I would save that data to a different datasource. Any ideas? Should I even be using a GridView, or something else?
-Thanks in advance-
View Complete Post