Results 1 to 2 of 2

Thread: [RESOLVED] Stored Procedure from Sub issue

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Resolved [RESOLVED] Stored Procedure from Sub issue

    Hi all,

    I am trying to modify a sub I have (that works) to use a stored procedure instead.

    My stored procedure is as follows:
    vb Code:
    1. CREATE PROCEDURE sp_GetOperatingSystem
    2. @Manufacturer INT,
    3. @OSType INT
    4. AS
    5. BEGIN
    6. SET NOCOUNT ON;
    7.  
    8. SELECT OperatingSystem.OperatingSystemName,
    9.        OperatingSystem.ManufacturerID_PKFK,
    10.        OperatingSystem.OperatingSystemTypeID_PKFK,
    11.        OperatingSystem_Manufacturers.ManufacturerID_PK,
    12.        OperatingSystem_Type.OperatingSystemTypeID_PK
    13. FROM OperatingSystem
    14. INNER JOIN OperatingSystem_Manufacturers
    15. ON OperatingSystem.ManufacturerID_PKFK = OperatingSystem_Manufacturers.ManufacturerID_PK
    16. INNER JOIN OperatingSystem_Type
    17. ON OperatingSystem.OperatingSystemTypeID_PKFK = OperatingSystem_Type.OperatingSystemTypeID_PK
    18. WHERE OperatingSystem.ManufacturerID_PKFK = @Manufacturer
    19. AND OperatingSystem.OperatingSystemTypeID_PKFK = @OSType
    20. ORDER BY OperatingSystem.OperatingSystemName
    21. END
    22. GO

    The way I use the sub is as follows:
    vb Code:
    1. Select Case cboOperatingSystemType.Text
    2.                     Case "Server"
    3.                         PopulateDropDownListDLL.PopulateDropDownListFromDB_WithWhereClauseX2(cboOperatingSystem, _
    4.                                                                                              2, _
    5.                                                                                              1, _
    6.                                                                                              My.Settings.NewConnectionString)
    7.                     Case "Workstation"
    8.                         PopulateDropDownListDLL.PopulateDropDownListFromDB_WithWhereClauseX2(cboOperatingSystem, _
    9.                                                                                              2, _
    10.                                                                                              2, _
    11.                                                                                              My.Settings.NewConnectionString)
    12.                 End Select

    The following screen shot shows my problem. I don't know what I am supposed to do. Any ideas? Thanks
    Attached Images Attached Images  

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Stored Procedure from Sub issue

    OK. stupid me. I figured it out. I did ," instead of ", with the parameters. Maybe I need to take a break

Posting Permissions

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



Click Here to Expand Forum to Full Width