Data Relationship binding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leon Shaw

    #1

    Data Relationship binding

    I have two Dropdownlist and one which is containing States and one
    containing Cities. I know how to do all the little databinding task in
    visual studios interface as well as set the relationship (parent, child,
    etc.). In the code behind file in page_load event I fill the data adapter
    and databind the State dropdownlist. I also set the on_change event for the
    Cities dropdownlist after a state is selected. However, When I run this page
    in the browser the state dropdownlist populate with the States, but after
    selecting a State the Cities dropdownlist DO NOTHING.
    What I'm I doing wrong? Could some one please send me some code that handle
    these action?
    I'm working with stored procedures from sql2000. Should I just set up a
    parameter procedure for the Cities dropdownlist (instead of Relationship in
    vs.net) and pass in the selected State?


  • Leon Shaw

    #2
    Re: Data Relationship binding


    But when doing things that way I get a System.Data.Rel atedView message in
    the child related (Cities) dropdownlist. What could I possibly be doing
    wrong?

    "Pete Wright" <pete@codemonke y.demon.co.uk> wrote in message
    news:benc91$ogq $10$8302bc10@ne ws.demon.co.uk. ..[color=blue]
    > I'm not sure I have a very good handle on exactly what it is your code is
    > doing, but your problem lies with how you've bound. Bind the cities drop
    > down to the relationship, not the table. That way it should refresh when[/color]
    the[color=blue]
    > state is changed.
    >
    > --
    > Peter Wright
    > Author of ADO.NET Novice To Pro, from Apress Inc.
    >
    >
    > _______________ ______________
    > "Leon Shaw" <vnality@msn.co m> wrote in message
    > news:%23lrsHFxR DHA.1868@TK2MSF TNGP11.phx.gbl. ..[color=green]
    > > I have two Dropdownlist and one which is containing States and one
    > > containing Cities. I know how to do all the little databinding task in
    > > visual studios interface as well as set the relationship (parent, child,
    > > etc.). In the code behind file in page_load event I fill the data[/color][/color]
    adapter[color=blue][color=green]
    > > and databind the State dropdownlist. I also set the on_change event for[/color]
    > the[color=green]
    > > Cities dropdownlist after a state is selected. However, When I run this[/color]
    > page[color=green]
    > > in the browser the state dropdownlist populate with the States, but[/color][/color]
    after[color=blue][color=green]
    > > selecting a State the Cities dropdownlist DO NOTHING.
    > > What I'm I doing wrong? Could some one please send me some code that[/color]
    > handle[color=green]
    > > these action?
    > > I'm working with stored procedures from sql2000. Should I just set up a
    > > parameter procedure for the Cities dropdownlist (instead of Relationship[/color]
    > in[color=green]
    > > vs.net) and pass in the selected State?
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Leon Shaw

      #3
      Re: Data Relationship binding


      But when doing things that way I get a System.Data.Rel atedView message in
      the child related (Cities) dropdownlist. What could I possibly be doing
      wrong?

      "Pete Wright" <pete@codemonke y.demon.co.uk> wrote in message
      news:benc91$ogq $10$8302bc10@ne ws.demon.co.uk. ..[color=blue]
      > I'm not sure I have a very good handle on exactly what it is your code is
      > doing, but your problem lies with how you've bound. Bind the cities drop
      > down to the relationship, not the table. That way it should refresh when[/color]
      the[color=blue]
      > state is changed.
      >
      > --
      > Peter Wright
      > Author of ADO.NET Novice To Pro, from Apress Inc.
      >
      >
      > _______________ ______________
      > "Leon Shaw" <vnality@msn.co m> wrote in message
      > news:%23lrsHFxR DHA.1868@TK2MSF TNGP11.phx.gbl. ..[color=green]
      > > I have two Dropdownlist and one which is containing States and one
      > > containing Cities. I know how to do all the little databinding task in
      > > visual studios interface as well as set the relationship (parent, child,
      > > etc.). In the code behind file in page_load event I fill the data[/color][/color]
      adapter[color=blue][color=green]
      > > and databind the State dropdownlist. I also set the on_change event for[/color]
      > the[color=green]
      > > Cities dropdownlist after a state is selected. However, When I run this[/color]
      > page[color=green]
      > > in the browser the state dropdownlist populate with the States, but[/color][/color]
      after[color=blue][color=green]
      > > selecting a State the Cities dropdownlist DO NOTHING.
      > > What I'm I doing wrong? Could some one please send me some code that[/color]
      > handle[color=green]
      > > these action?
      > > I'm working with stored procedures from sql2000. Should I just set up a
      > > parameter procedure for the Cities dropdownlist (instead of Relationship[/color]
      > in[color=green]
      > > vs.net) and pass in the selected State?
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...