Results 1 to 10 of 10

Thread: VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,086

    VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

    Since they are no longer used in ADO.NET , this shows you how to simulate (move next, move previous , move fist , move last) in ADO.NET

    enjoy !
    Attached Files Attached Files

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    You are trying to re-invent the wheel here. Check out the CurrencyManager object.

  3. #3

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,086
    Originally posted by Lethal
    You are trying to re-invent the wheel here. Check out the CurrencyManager object.
    No , I'm not . CurrencyManager is a Data Binding object but the method I implemented uses no Binding objects . Data Binding is hell

  4. #4

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,086
    Sorry guys if you find the demo buggy but I really didn't have time to update it . It does work though .

  5. #5
    Frenzied Member
    Join Date
    Apr 2003
    Location
    The Future - Skynet
    Posts
    1,157

    Thumbs up

    Great example. If you have more, please post!
    I'll Be Back!

    T-1000

    Microsoft .Net 2005
    Microsoft Visual Basic 6
    Prefer using API

  6. #6
    New Member
    Join Date
    Jun 2006
    Posts
    2

    Re: VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

    hmmm
    i just created a class which has an embedded binding component and then created the movenext moveback movelast functions...works just like it did in vb6.
    now if i can only get the update command to autobuild update statements for left joined queries...(which is another reason why ado.net is a giant step back if you use common sense..).The people responsible for this (delphi programmers i heard...) must have been on crack when they developed ado.net.
    The whole logic behind it is flawed and doesn't save time AT ALL.

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

    Quote Originally Posted by Pirate
    No , I'm not . CurrencyManager is a Data Binding object but the method I implemented uses no Binding objects . Data Binding is hell
    Actualy that's a mythconception in .NET.... databinding in .NET is FAR superior databinding in previous eras. I've done it a number of times now and it is so freakin easy and stabler than it ever used to be.


    Quote Originally Posted by Looooooka
    hmmm
    i just created a class which has an embedded binding component and then created the movenext moveback movelast functions...works just like it did in vb6.
    now if i can only get the update command to autobuild update statements for left joined queries...(which is another reason why ado.net is a giant step back if you use common sense..).The people responsible for this (delphi programmers i heard...) must have been on crack when they developed ado.net.
    The whole logic behind it is flawed and doesn't save time AT ALL.
    Again, Eh? What kind of queries are you building that it can't update? If it can't properly build the update query from your select then, 1) the database design needs to be looked at, or 2) You can build the UPDATE yourself.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    New Member
    Join Date
    Jun 2006
    Posts
    2

    Red face Re: VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

    techgnome
    the database design is not the problem.it's flawless

    But(btw we're using visual studio 2005) let's say you LEFT join 2 tables.

    Select tableone.*,tabletwo.magicfield FROM tableone LEFT JOIN tabletwo ON tableone.id=tabletwo.oid

    Now i'm not really expecting the update builder to be smart enough to create an insert statement for this sort of result because it's impossible...but a bloody update statement should be built by itself.
    The ado from VB6 could update this with no problems.

    and no i do not want to build the update statement by myself since :
    a)this will take time for no good reason and give microsoft the idea that ado.net was an improvement
    b)we're actually using a lot of dynamic fields(the user can move and play with fields a lot)

    So if you know if this can be done somehow magically with the use of the commandbuilder(which works beautifully in a single table query) i would be jumping up and down with joy.

    I'm googling right now if there's an alternative ado.net component out there and hmm the once that MIGHT be able to do this cost around 2000$ plus i'm not really sure they can do the job.
    But since i'm not really keen on the idea of spending the rest of my VB days writing delete update and delete statements for such a trivial thing as a simple left join I'm still hopeful that there's a way out of this.
    I'll probably make a post on this here because this is really out of the current topic .

    But if you have a solution i'm all ears and i'll take every last word back.
    (but i'm pretty sure the solution will involve 20 lines of updatebuilder code).
    Last edited by Looooooka; Jun 28th, 2006 at 03:27 PM.

  9. #9
    New Member
    Join Date
    Apr 2010
    Posts
    1

    Thumbs up Re: VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

    I've more accurate version of Pirate's program Using BindingContext. You need not maintain the value of counter while moving to records.
    Attached Files Attached Files
    Last edited by Hack; Apr 24th, 2010 at 06:15 AM.

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB.NET : How to simulate (movenext, moveprevious ..etc) in ADO.NET

    Quote Originally Posted by Madan.76 View Post
    I've more accurate version of Pirate's program Using BindingContext. You need not maintain the value of counter while moving to records.
    Thank you for your CodeBank submission.

    Per this CodeBank policy, I have edited your attachment and removed all compiled code.

    We welcome and appreciate all entries into our Codebank, but ask that source code only be included with anything attached.

    Thank you.

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