Extracting Value


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Extracting Value

  1. #1
    Join Date
    Mar 2006
    Posts
    29

    Extracting Value

    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?


    Code:
                rowsAffected = Staff_AssignmentTableAdapter.Insert(SelectedStaff)
                rowsAffected = TreatmentTableAdapter.Insert(Patient_No, Visit_No, Staff_Assignment, Treatment)

  2. #2
    Join Date
    Mar 2006
    Posts
    100
    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

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  4. #4
    Join Date
    Mar 2006
    Posts
    29
    I have restructured everything.

    Code:
    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 ")
    How to extract @Visit_No to a variable?
    Last edited by claudecalleja; 05-12-2006 at 07:58 AM.

Similar Threads

  1. extracting a table from a html web page
    By bob1983 in forum Java
    Replies: 2
    Last Post: 02-28-2006, 03:27 AM
  2. Extracting two string texts...
    By kepler in forum VB Classic
    Replies: 2
    Last Post: 05-15-2005, 06:14 PM
  3. Extracting from a CAB file
    By Tom Cassidy in forum VB Classic
    Replies: 0
    Last Post: 08-26-2002, 10:16 AM
  4. handling error while extracting records
    By Hardik Sukhadia in forum Java
    Replies: 1
    Last Post: 06-05-2002, 10:04 AM
  5. Replies: 0
    Last Post: 10-18-2001, 06:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center