Results 1 to 2 of 2

Thread: saving data from a datagrid to a database

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    saving data from a datagrid to a database

    Hello,

    I have a datagrid which l want to save the contents to the database. I am not sure how to do this. Would l have to save one row at a time, or can l save everything and at once. I am using C# with SQL Server 2000. I normally write stored procedures for database operations. But with the datagrid I am not sure how this is done.

    Some code examples would be very grateful.

    Thanks in advance,

    Steve
    steve

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: saving data from a datagrid to a database

    That depends on how you populated the datagrid and dataset in the first place. If you used a dataadapter, then any changes you made in the datagrid should be reflected in your dataset. You can then run the dataadapater's update method and the rows which have been changed will be updated back to the database.

    If that is not the case then you'll need to tell us how you populated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width