Results 1 to 4 of 4

Thread: Adding new Record at the end of the defaultview

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    220

    Adding new Record at the end of the defaultview

    I want to use the AddNew function to add new records to a DefaultView. However, every new row must sit at the bottom sothat when I loop I only access the old records which would sit at the top. I used dv.AddNew() function but the new records get mixed up. How can I do that, please. Thanks for helping.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    220

    Re: Adding new Record at the end of the defaultview

    Just make sure the dataview you are adding newRows to is not sorted in the first place.I think that is the cause of your headache. Normally every new Row is added at the bottom of the table as you want.

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Adding new Record at the end of the defaultview

    This is new. Answering your own questions? Did you give yourself rep?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Adding new Record at the end of the defaultview

    If you are going to not sort the DataView to make sure that the row is at the bottom then why use the DataView at all? Why not just use the DataTable?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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