Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. is it possible??

is it possible??

Scheduled Pinned Locked Moved Database
databasetutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imsathy
    wrote on last edited by
    #1

    hi... how to pass muliple option from a drop down to the stored procedure as string and then pass the values to the conditional clause of the procedure. sathy

    C 1 Reply Last reply
    0
    • I imsathy

      hi... how to pass muliple option from a drop down to the stored procedure as string and then pass the values to the conditional clause of the procedure. sathy

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      imsathy wrote:

      muliple option from a drop down

      A drop down only permits one option to be selected at a time.

      imsathy wrote:

      to the stored procedure as string

      string value = MyDropDownList.SelectedValue;
      SqlCommand cmd = new SqlCommand(myConnection, "StoredProc");
      cmd.CommandType = CommandType.StoredProcdure;
      cmd.Parameters.Add("@paramName", value);
      SqlDataReader reader = cmd.ExecuteReader(); // Assumes connection is open.

      imsathy wrote:

      then pass the values to the conditional clause of the procedure

      For example:

      CREATE PROCEDURE dbo.StoredProc
      @paramName varchar(100)
      AS
      SELECT * FROM SomeTable
      WHERE someColumn = @paramName
      GO

      Does this help? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

      I 1 Reply Last reply
      0
      • C Colin Angus Mackay

        imsathy wrote:

        muliple option from a drop down

        A drop down only permits one option to be selected at a time.

        imsathy wrote:

        to the stored procedure as string

        string value = MyDropDownList.SelectedValue;
        SqlCommand cmd = new SqlCommand(myConnection, "StoredProc");
        cmd.CommandType = CommandType.StoredProcdure;
        cmd.Parameters.Add("@paramName", value);
        SqlDataReader reader = cmd.ExecuteReader(); // Assumes connection is open.

        imsathy wrote:

        then pass the values to the conditional clause of the procedure

        For example:

        CREATE PROCEDURE dbo.StoredProc
        @paramName varchar(100)
        AS
        SELECT * FROM SomeTable
        WHERE someColumn = @paramName
        GO

        Does this help? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

        I Offline
        I Offline
        imsathy
        wrote on last edited by
        #3

        Select Products im filling this dropdown dynamically thro xml and js i want the multiple selected values from thus drop to be a comma separated string and pass it as a parameter to a stored procedure.. and is there a way to pass these multiple values to the where clause of the sp here how to give the multiple values of the serial nos from the string of the sp to this query SELECT ... ... ... WHERE serial_number =@serialNo sathy

        P 1 Reply Last reply
        0
        • I imsathy

          Select Products im filling this dropdown dynamically thro xml and js i want the multiple selected values from thus drop to be a comma separated string and pass it as a parameter to a stored procedure.. and is there a way to pass these multiple values to the where clause of the sp here how to give the multiple values of the serial nos from the string of the sp to this query SELECT ... ... ... WHERE serial_number =@serialNo sathy

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          Are you required to use a combobox dropdown? Why I ask is because listboxes can do multiple selections. PJC

          I 1 Reply Last reply
          0
          • P Paul Conrad

            Are you required to use a combobox dropdown? Why I ask is because listboxes can do multiple selections. PJC

            I Offline
            I Offline
            imsathy
            wrote on last edited by
            #5

            thanks guru but my requirement is for tht only .... i have sorted tht out .. :) sathy

            P 1 Reply Last reply
            0
            • I imsathy

              thanks guru but my requirement is for tht only .... i have sorted tht out .. :) sathy

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              Glad you sorted that out. Have a good day, Paul

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups