Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2010
    Location
    New Jersey
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Visual studio sp problems

    I have a sp that give me the results exactly the way I want it to when I run it by itself. When I use it as the datasource for a report I am creating I do not see the results correctly. Here is the sp, I am having problems with the bonds part. In the report I only see the cusip and the coupon and they just repeat the data from the first record over and over. The other fields are blank. I am very new to this and don't know where to go from here. The first part notes works fine.
    IF UPPER(@SecurityType) = 'N'
    BEGIN
    ---------------------------------------- Notes -----------------------------------------------------------------------
    SELECT CM.CUSIP, BD.Coupon, NB.DueDate, BD.PurchaseYield, NB.syndicateID
    FROM SYN_NoteBasicInput NB


    INNER JOIN SYN_NoteBidding BD ON NB.SyndicateID = BD.SyndicateID
    INNER JOIN SYN_NoteCounselMemo CM ON NB.SyndicateID = CM.SyndicateID
    WHERE NB.SyndicateID = @SyndicateID



    END
    ELSE
    BEGIN
    ---------------------------------------- Bonds -----------------------------------------------------------------------
    SELECT Cusip, Coupon,MaturityDate,Reoffer, syndicateID
    FROM SYN_BondSerialMaturity
    WHERE SyndicateID = @SyndicateID

    UNION

    SELECT Cusip, Coupon,MaturityDate,Reoffer,SyndicateID
    FROM SYN_BondTermMaturity
    WHERE SyndicateID = @SyndicateID

    END

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by CKnoll View Post
    In the report I only see the cusip and the coupon and they just repeat the data from the first record over and over. The other fields are blank.
    Is there a way to see all the queries sent from your application to the database server, to confirm that the correct parameters and column names are being sent?

    Edit: You might want to make all the column names the same, or use two different procedures/views.

  3. #3
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Manchester, United Kingdom
    Posts
    116
    Thanks
    8
    Thanked 17 Times in 16 Posts
    As jscher says, I would alias all the fields so whatever code path is taken the dataset returned has the same field names. Although SQL Server can execute the SP the VS table adapter isn't going to know what to do with the data coming in after it sees MaturityDate instead of DueDate. (I'd like to think it would pick up SyndicateID but Hey, Microsoft?) (maybe that initial capital is fooling something)

    Ian

    PS jscher - 21989 posts and no thanks? Is that the new BBS or is this community unfriendly to the mods?

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by iansavell View Post
    PS jscher - 21989 posts and no thanks? Is that the new BBS or is this community unfriendly to the mods?
    Thank you for your concern. There was a problem converting the "thumbs up" count from the other software. We didn't think anyone really cared, but maybe that was because it wasn't very visible...

    Anyway, a personal reply often is more meaningful. My favorite thank you post:

    "Oh My God!!! You totally solved it!! Thanks so much, DUDE!!!!"

    It doesn't get much better than that. Well, except for those who bought me books off of Amazon.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •