How to edit, delete and modify rows - dataGridView

Discussion in 'ASP .Net' started by S_K, Jan 26, 2009.

  1. S_K

    S_K Guest

    Hi,

    I have a dataGridView where everything seems to be set up to add,
    modify and delete rows. However I can't get the dataGridView to
    actually SAVE THE CHANGES back to the database.

    Any help?

    Thanks
    Steve
     
    S_K, Jan 26, 2009
    #1
    1. Advertising

  2. On Jan 26, 9:31 pm, S_K <> wrote:
    > Hi,
    >
    > I have a dataGridView where everything seems to be set up to add,
    > modify and delete rows. However I can't get the dataGridView to
    > actually SAVE THE CHANGES back to the database.
    >
    > Any help?
    >
    > Thanks
    > Steve


    Hi Steve

    take a look an example at http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.aspx
    or post your code here if you cannot find where your problem is.

    Hope this helps
     
    Alexey Smirnov, Jan 26, 2009
    #2
    1. Advertising

  3. S_K

    Miro Guest

    Im assuming you dont have the
    ..endedit

    or the acceptchanges()
    before your update button.

    Can you post some code?

    Miro

    "S_K" <> wrote in message
    news:...
    > Hi,
    >
    > I have a dataGridView where everything seems to be set up to add,
    > modify and delete rows. However I can't get the dataGridView to
    > actually SAVE THE CHANGES back to the database.
    >
    > Any help?
    >
    > Thanks
    > Steve
     
    Miro, Jan 26, 2009
    #3
  4. S_K

    S_K Guest

    On Jan 26, 1:41 pm, "Miro" <> wrote:
    > Im assuming you dont have the
    > .endedit
    >
    > or the acceptchanges()
    > before your update button.
    >
    > Can you post some code?
    >
    > Miro
    >
    > "S_K" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi,

    >
    > > I have a dataGridView where everything seems to be set up to add,
    > > modify and delete rows. However I can't get the dataGridView to
    > > actually SAVE THE CHANGES back to the database.

    >
    > > Any help?

    >
    > > Thanks
    > > Steve- Hide quoted text -

    >
    > - Show quoted text -


    I'm just a newbee here. The dataGridView will allow me to change the
    data within the cells or add a new row, but the changes never get to
    the database. I read the example on the MSDN but it dosen't seem to
    have anything on updating the database.

    What do you mean "or the acceptchanges()
    before your update button. "??? I don't see any acceptchanges() method
    in the dataGridView events!?

    Thanks again for your help.
     
    S_K, Jan 27, 2009
    #4
  5. On Jan 27, 5:39 am, S_K <> wrote:
    > On Jan 26, 1:41 pm, "Miro" <> wrote:
    >
    >
    >
    > > Im assuming you dont have the
    > > .endedit

    >
    > > or the acceptchanges()
    > > before your update button.

    >
    > > Can you post some code?

    >
    > > Miro

    >
    > > "S_K" <> wrote in message

    >
    > >news:....

    >
    > > > Hi,

    >
    > > > I have a dataGridView where everything seems to be set up to add,
    > > > modify and delete rows. However I can't get the dataGridView to
    > > > actually SAVE THE CHANGES back to the database.

    >
    > > > Any help?

    >
    > > > Thanks
    > > > Steve- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > I'm just a newbee here. The dataGridView will allow me to change the
    > data within the cells or add a new row, but the changes never get to
    > the database. I read the example on the MSDN but it dosen't seem to
    > have anything on updating the database.
    >
    > What do you mean "or the acceptchanges()
    > before your update button. "??? I don't see any acceptchanges() method
    > in the dataGridView events!?
    >
    > Thanks again for your help.


    Here's more advanced example
    http://msdn.microsoft.com/en-us/library/ms972948.aspx

    Please let me know if you have any questions
     
    Alexey Smirnov, Jan 27, 2009
    #5
  6. S_K

    S_K Guest

    On Jan 27, 2:27 am, Alexey Smirnov <> wrote:
    > On Jan 27, 5:39 am, S_K <> wrote:
    >
    >
    >
    >
    >
    > > On Jan 26, 1:41 pm, "Miro" <> wrote:

    >
    > > > Im assuming you dont have the
    > > > .endedit

    >
    > > > or the acceptchanges()
    > > > before your update button.

    >
    > > > Can you post some code?

    >
    > > > Miro

    >
    > > > "S_K" <> wrote in message

    >
    > > >news:....

    >
    > > > > Hi,

    >
    > > > > I have a dataGridView where everything seems to be set up to add,
    > > > > modify and delete rows. However I can't get the dataGridView to
    > > > > actually SAVE THE CHANGES back to the database.

    >
    > > > > Any help?

    >
    > > > > Thanks
    > > > > Steve- Hide quoted text -

    >
    > > > - Show quoted text -

    >
    > > I'm just a newbee here. The dataGridView will allow me to change the
    > > data within the cells or add a new row, but the changes never get to
    > > the database. I read the example on the MSDN but it dosen't seem to
    > > have anything on updating the database.

    >
    > > What do you mean "or the acceptchanges()
    > > before your update button. "??? I don't see any acceptchanges() method
    > > in the dataGridView events!?

    >
    > > Thanks again for your help.

    >
    > Here's more advanced examplehttp://msdn.microsoft.com/en-us/library/ms972948.aspx
    >
    > Please let me know if you have any questions- Hide quoted text -
    >
    > - Show quoted text -


    I've been doing some reading....
    Is it true that a DataGridView (versus a GridView) is only READING the
    data? Thus no editing/deleting possible?
    The more advanced example only applies to the ASP.NET GridView....

    Thanks again for your help..

    Steve
     
    S_K, Jan 27, 2009
    #6
    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. =?Utf-8?B?a2Vu?=
    Replies:
    1
    Views:
    10,339
    Wiktor Zychla [C# MVP]
    Jan 23, 2006
  2. rgparkins

    Datagridview edit row with checkbox

    rgparkins, Oct 5, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,414
    rgparkins
    Oct 5, 2007
  3. Replies:
    1
    Views:
    899
    Munna
    Jul 6, 2008
  4. Andy B
    Replies:
    0
    Views:
    444
    Andy B
    Aug 8, 2008
  5. John C. Marx

    DataGridView - Edit Multiple Cells

    John C. Marx, Jul 5, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    1,011
    John C. Marx
    Jul 5, 2007
Loading...

Share This Page