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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. databound controls

databound controls

Scheduled Pinned Locked Moved Database
6 Posts 2 Posters 1 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.
  • K Offline
    K Offline
    Kunal P
    wrote on last edited by
    #1

    hi. i am developing a web based application in Visual WeB Developer EXPRESS. I have a Drop down list that which is databound to a particular table. Now i want that wen i select a particular field from the Drop Down List, a table of the same name shud be accessed, and a particular column be filled in the Listbox Control. i hope i am clear..

    Kunal Piyush

    S 1 Reply Last reply
    0
    • K Kunal P

      hi. i am developing a web based application in Visual WeB Developer EXPRESS. I have a Drop down list that which is databound to a particular table. Now i want that wen i select a particular field from the Drop Down List, a table of the same name shud be accessed, and a particular column be filled in the Listbox Control. i hope i am clear..

      Kunal Piyush

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      Write a Stored procedure with argumnet (dropdownlist value) call the stored procedure by passing the value inseide the stored procedure write a select query with condition bind the output of stored procedure with listbox

      Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com Score it if you like my post

      K 2 Replies Last reply
      0
      • S Sylvester george

        Write a Stored procedure with argumnet (dropdownlist value) call the stored procedure by passing the value inseide the stored procedure write a select query with condition bind the output of stored procedure with listbox

        Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com Score it if you like my post

        K Offline
        K Offline
        Kunal P
        wrote on last edited by
        #3

        hey never wrote a stored procedure.. all i do is simply specify the query within the code.. and get it executed.. so could you please elaborate on this. sorryy..

        Kunal Piyush

        1 Reply Last reply
        0
        • S Sylvester george

          Write a Stored procedure with argumnet (dropdownlist value) call the stored procedure by passing the value inseide the stored procedure write a select query with condition bind the output of stored procedure with listbox

          Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com Score it if you like my post

          K Offline
          K Offline
          Kunal P
          wrote on last edited by
          #4

          hi i wrote this piece of code... and i am getting a error stating.. "Invalid Syntax near [valuename]" string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["diag"].ConnectionString; SqlConnection conn = new SqlConnection(connString); try { conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = "Select * from '" + DropDownList1.SelectedValue + "'"; SqlDataReader dread = cmd.ExecuteReader(); dread.Read(); while (dread.Read()) { ListBox1.Items.Add(dread["TestName"].ToString()); } conn.Close(); } catch(Exception ex) { failed.Text = ex.Message; }

          Kunal Piyush

          S 1 Reply Last reply
          0
          • K Kunal P

            hi i wrote this piece of code... and i am getting a error stating.. "Invalid Syntax near [valuename]" string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["diag"].ConnectionString; SqlConnection conn = new SqlConnection(connString); try { conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = "Select * from '" + DropDownList1.SelectedValue + "'"; SqlDataReader dread = cmd.ExecuteReader(); dread.Read(); while (dread.Read()) { ListBox1.Items.Add(dread["TestName"].ToString()); } conn.Close(); } catch(Exception ex) { failed.Text = ex.Message; }

            Kunal Piyush

            S Offline
            S Offline
            Sylvester george
            wrote on last edited by
            #5

            cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";

            Regards, Sylvester G sylvester_g_m@yahoo.com

            K 1 Reply Last reply
            0
            • S Sylvester george

              cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";

              Regards, Sylvester G sylvester_g_m@yahoo.com

              K Offline
              K Offline
              Kunal P
              wrote on last edited by
              #6

              sylvesterg wrote:

              cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";

              i tried it.. now the error is not coming.. but still no retrival of rows to the listbox as well..

              Kunal Piyush

              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