Problem databinding to syscolumns table

Discussion in 'ASP .Net' started by cashdeskmac, Sep 15, 2009.

  1. cashdeskmac

    cashdeskmac Guest

    Hi,

    I have a databound DropDownList on my my page and the SelectCommand is
    "Select Column1, Column2 FROM Table1". I have autopostback="true" and a
    breakpoint in the SelectedIndexChanged eventhandler is hit every time.

    I then change the SelectCommand to "SELECT [name], [id] from syscolumns" and
    suddenly it doesn't want to play anymore. The DropDownList is populated
    without a problem, but when I select a value from the list it does the
    postback without raising the SelectedIndexChanged event. It then selects the
    first item in the list, not the one I selected. If I click the back button
    in my browser it shows the item I selected.

    Is there something special about the syscolumns table that causes this to
    happen?

    I tried creating a brand new page and added the same functionality but it
    gave the same results. When I then changed the SelectCommand on this new
    page to point to another (user defined) table, it works without a problem.

    Please help!
     
    cashdeskmac, Sep 15, 2009
    #1
    1. Advertising

  2. =?Utf-8?B?Y2FzaGRlc2ttYWM=?= <>
    wrote in news::

    > Hi,
    >
    > I have a databound DropDownList on my my page and the SelectCommand is
    > "Select Column1, Column2 FROM Table1". I have autopostback="true" and
    > a breakpoint in the SelectedIndexChanged eventhandler is hit every
    > time.
    >
    > I then change the SelectCommand to "SELECT [name], [id] from
    > syscolumns" and suddenly it doesn't want to play anymore. The
    > DropDownList is populated without a problem, but when I select a value
    > from the list it does the postback without raising the
    > SelectedIndexChanged event. It then selects the first item in the
    > list, not the one I selected. If I click the back button in my
    > browser it shows the item I selected.
    >
    > Is there something special about the syscolumns table that causes this
    > to happen?
    >
    > I tried creating a brand new page and added the same functionality but
    > it gave the same results. When I then changed the SelectCommand on
    > this new page to point to another (user defined) table, it works
    > without a problem.
    >
    > Please help!



    I know of nothing with the syscolumns view that should cause this
    behavior, but perhaps there is something with views? You can always
    encapsulate the call in a stored procedure and see if that solves the
    problem. If so, you found something I am not aware of. The sproc would
    look like this:

    CREATE PROCEDURE GetSysColumns
    AS

    SELECT [name], [id] from syscolumns

    If I think of anything else, i will post later.

    Peace and Grace,


    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    My vacation and childhood cancer awareness site:
    http://www.crazycancertour.com

    *******************************************
    | Think outside the box! |
    *******************************************
     
    Gregory A. Beamer, Sep 15, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Big Dave
    Replies:
    1
    Views:
    537
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 7, 2004
  2. Lamberti Fabrizio

    table and databinding

    Lamberti Fabrizio, Apr 30, 2004, in forum: HTML
    Replies:
    2
    Views:
    500
    Jukka K. Korpela
    May 1, 2004
  3. jobs
    Replies:
    0
    Views:
    1,764
  4. Earl Teigrob
    Replies:
    1
    Views:
    444
    Shravan
    Mar 1, 2004
  5. Zebrahead

    Databinding with intermediary table

    Zebrahead, Mar 28, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    125
    Zebrahead
    Mar 28, 2007
Loading...

Share This Page