C#, grid and databinding

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

    #1

    C#, grid and databinding

    Hi,

    Let's say that I bind a grid to a dataset populated from the content of
    a DB table.

    1- Does this grid will be updated if the content of the DB table is
    modified?

    2- Does DB table content can be modified by the grid content?

    Thanks!
    Marty
  • Marina

    #2
    Re: C#, grid and databinding

    Neither of these will happen for you - how could they? You bound that data
    to a dataset - this is just whatever you retrieved from the database. But, a
    dataset is just some rows/columns - it doesn't have to come from a database,
    it doesn't know how it got populated, from what data source, how it can
    update the data source, etc. The dataset could have been returned from a
    web service, or populated manually, etc - there is no way for the dataset to
    figure out where and how it should update when the user changes something on
    the grid bound to the dataset. There is also no way for the dataset to
    somehow monitor the database automatically waiting for changes - not to
    mention all the possible problems you could have if the user updated a row
    in the grid that now got updated in the database, and how to resolve this.

    The list of reasons why this could never just happen automatically goes on
    and on...

    "Marty" <xmarty99@hotma il.com> wrote in message
    news:roAuf.2976 9$m05.14240@clg rps12...[color=blue]
    > Hi,
    >
    > Let's say that I bind a grid to a dataset populated from the content of a
    > DB table.
    >
    > 1- Does this grid will be updated if the content of the DB table is
    > modified?
    >
    > 2- Does DB table content can be modified by the grid content?
    >
    > Thanks!
    > Marty[/color]


    Comment

    • Marty

      #3
      Re: C#, grid and databinding

      Hi Marina,

      Thank you for your reply. I should have ask, "what is the best way to
      do it?" :)

      Do you have a link or tutorial I could read on the subject?

      Thank you!
      Marty




      Marina wrote:[color=blue]
      > Neither of these will happen for you - how could they? You bound that data
      > to a dataset - this is just whatever you retrieved from the database. But, a
      > dataset is just some rows/columns - it doesn't have to come from a database,
      > it doesn't know how it got populated, from what data source, how it can
      > update the data source, etc. The dataset could have been returned from a
      > web service, or populated manually, etc - there is no way for the dataset to
      > figure out where and how it should update when the user changes something on
      > the grid bound to the dataset. There is also no way for the dataset to
      > somehow monitor the database automatically waiting for changes - not to
      > mention all the possible problems you could have if the user updated a row
      > in the grid that now got updated in the database, and how to resolve this.
      >
      > The list of reasons why this could never just happen automatically goes on
      > and on...
      >
      > "Marty" <xmarty99@hotma il.com> wrote in message
      > news:roAuf.2976 9$m05.14240@clg rps12...
      >[color=green]
      >>Hi,
      >>
      >>Let's say that I bind a grid to a dataset populated from the content of a
      >>DB table.
      >>
      >>1- Does this grid will be updated if the content of the DB table is
      >>modified?
      >>
      >>2- Does DB table content can be modified by the grid content?
      >>
      >>Thanks!
      >>Marty[/color]
      >
      >
      >[/color]

      Comment

      Working...