So I am updating a couple of tables. In the second table (Treatment) I need to get the Staff_Assignment value. This is an automatic incremented Primary Key. How can I extract that, and write it to the Treatment Table?
rowsAffected = Staff_AssignmentTableAdapter.Insert(SelectedStaff)
rowsAffected = TreatmentTableAdapter.Insert(Patient_No, Visit_No, Staff_Assignment, Treatment)
I am having a similar problem so let me know if you get it I want to run an insert query like so..
Dim daDocInsert As New DocInformationTableAdapters.QueriesTableAdapter
daDocInsert.InputDocInsertCommandTest(dateFiled, typeCode, numberOfPages, summary, transCode, "", Date.Now, "0", "1")
and there is an additional field which is a GUID and I need to know how to get that value. I know there is a @@identity but I don't know how to use it in VS 2005 or even how VB.net handles the incoming response
I have restructured everything.
How to extract @Visit_No to a variable?
Dim VisitInsert As SqlCommand
VisitInsert = New SqlCommand("@Patient_No int, @Diagnosis nvarchar(100), @Symptoms nvarchar(100), @Admission_Date nvarchar(20), @Discharge_Date nvarchar(20), @Remarks nvarchar(100), @Visit_No int AS INSERT INTO Visit (Patient_No, Diagnosis, Symptoms, Admission_Date, Discharge_Date, Remarks) VALUES (@Patient_No, @Diagnosis, @Symptoms, @Admission_Date, @Discharge_Date, @Remarks) SET @Visit_No = SCOPE_IDENTITY() Return ")