Results 1 to 14 of 14

Thread: Seriously, a book suggestion on VB.NET changes from Classic...

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Question Seriously, a book suggestion on VB.NET changes from Classic...

    I realize, from scanning threads about books, that this is inviting a lot of sarcasm and humor, but so be it:

    With the help of some books (IDG, and others) I had gotten myself somewhat comfortable with casual programming in VB 5.0 / 6.0 (though only my 5.0 compiler worked properly). I made a couple of handy aps, such as a timecard calculator for a friend who worked in payroll and was driven nuts by math related to fractional hours, or a "flat-file" database (very generic). My pride and joy was a text editor for raw HTML that would insert a template, and featured buttons to insert frequently used code segments, such as images, tables, double breaks, etc. (even four customizable buttons!).

    Well, somewhere between the last application that I wrote and now, the HDD that contained VB 5.0 crashed hard. So I found VB.NET 2005 for a reasonable price, and here I am.

    Some things are very intuitive, and the IDE makes useful suggestions most of the time, but at least two things that were easy in VB Classic are mind-blowing in VB.NET: Printing and Databases.

    I'd like to write an ap that uses an excel spreadsheet for a database back end, and I've got a training-system ap I'd like to write that requires printing a progress report at the end. I've tried reading other people's snippets and trying to make sense of dataset datagrid datasource ... Yeah, it's making my brain hurt. I've declared the hell out of things and tried to make ADO.OBDC or ADO.OleDB work, but it's making me say bad words and drink coffee.

    So I'm thinking that I need a book that specifically addresses how to take what used to be easy in Classic and explains how it works in VB.NET.

    Yes, I did read threads here on databases. Even cut and pasted a bit. Still confused. Got a Wrox book on VB.NET 2005 (by a guy with lots of teeth). Talked about a lot of stuff, but all the code examples failed miserably (the error codes came up "What Language are you writing?"). Baffled as I ever was.

    Any suggestions for a book that makes Printing and Databases under VB.Net vaguely comprehensible?

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Search for something along the lines of "Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic.NET".

    I have requested the thread moved to the general developer section to avoid humorous posts.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Thanks for the suggestion and the request. I appreciate both.

    I did find one book "Start to Finish" which promises to build a Database ap with printable reports, so I got that one, but I remain open to further suggestions also.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,044

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    I would guess that the reason you are getting tripped up is that you have a mental model of how database interactions work (as far as I'm concerned, printing sucked in VB 5/6, so I care little about how different that is from .NET) based on how database interactions worked in VB5. How that mental model was formed depends on what you were working with back then. I liked DAO, myself, as it tended to be pretty fast, but there were other alternatives. The problem with moving from there to a new mental model is that you will first try to force the new behavior into your previous model. That doesn't work very well. Throwing out the old model so that you can start over with a new model, isn't easy, but it's pretty much what you need to do.
    My usual boring signature: Nothing

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Microsoft used to provide a free eBook about VB.NET for VB6 developers. It might be worth searching for that on MSDN.

    I have to agree with Shaggy that your issue with data access really is the fact that you're trying to make ADO.NET fit into what you already know about ADO or some other technology and it's just not going to. It's different, but it's certainly not especially hard.

    I know very little about how printing worked in VB6 or earlier but I will say that it's not exactly simple in .NET, but it is very powerful. Printing in Windows Forms uses GDI+, which is the same technology used to draw on the UI and Images. As such, you simply draw a picture of what you want on a virtual canvas and that will appear on the printed page. The tricky part is the calculations required to determine what to draw where and especially where to insert page breaks.

    The most important thing is that you start with an open mind. When moving from VB6 or earlier to VB.NET, treat it like a new language... because it is. Just assume that everything is going to be different and consider it a bonus when something turns out to be the same.

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    I found this, if it's what you're talking about, but it seems to be more of a "So your company used to develop in 6.0 and now you're developing in .NET, well, here's how to go through the administrative process of porting your old programs" rather than, "Here's how the new functions work."

    http://www.microsoft.com/en-us/downl....aspx?id=13232

    I'm quite willing to throw out the old paradigm and develop a new one, no issue with that, but I'm looking for a step-by-step explanation of the new printing and data paradigms, which don't seem to be available. Most of the .NET books I'm finding seem to infer that you're already familiar with the paradigm, and just need to look up the right connection string, or something like that.

    I'd like a book with:

    Here's how printing is done under .NET:

    First, put this control on your form. Then go to general declarations and say this, but if you're doing that, put that. Now under your class, insert this code to make a print function, unless your printer is a Daihatsu, in which case you put this.Then, under your print button control, put this code for On_click, and this code for Right_click.

    And so forth.
    Instead of

    The print function can be greatly enhanced by doing X where you would normally do YY, except that if the printer's a Daihatsu, you should find the print connection string least relevant to the subdermal hematoma and excise the tissue.
    (No, I don't think Daihatsu makes printers, but you see what I'm saying. A complete layout/roadmap of the paradigm, for both printing and databases, would be a lovely thing indeed).

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    But thanks for the tip; I do appreciate it.

    And for that matter, if anyone knows a really good tutorial that lays it out from scratch, I'd love to see that also -- for either printing or data access.

  8. #8

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    I did find this tutorial, and I'm going to give this a shot to see if it'll work for me:

    http://www.vbforums.com/showthread.p...8-Tutorial-%29

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,044

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    I doubt that such a tutorial could be written. There appear to be lots of different ways that a person can learn. It would be easy enough to lay out how to do a specific task, such as figuring out a connection string (there's a good website for that, beginner or otherwise). However, it wouldn't be so easy to create a tutorial for getting data from a database. Just from looking at threads on here, there are so many different ways that you can go about it that any one tutorial would leave out lots of them. For instance, if you want to fill a standard datatable with some data, you can use a Dataadapter, a Datareader, or possibly a Tableadapter (depending on what I meant by 'standard datatable'). As far as using a datareader or a dataadapter, you can manage the connection in a couple different ways, create a command object in a couple different ways, and so on. That means that the tutorial would get into permutations, which would cause more frustration than benefit. As an example, the Mendhakian tutorial you linked to ignores datareaders, ignores the using statement, ignores any other way of cleaning up the objects used, and so on. While it's a good start, the same steps could be performed with code that looks NOTHING like what he wrote (other than the connection string and the SQL itself).

    Personally, I prefer the techniques that JMC has mentioned in his blog posts, though I forget whether they are laid out as a tutorial or not. However, if you are just learning, then learning two different methods that bear little resemblance to each other, would just cause confusion. Furthermore, none of these techniques seem all that similar to what I used to do with DAO back in VB5/6. The recordset is more like a datareader than a datatable, though I think that it bears some resemblance to both, and isn't truly either. Better yet, you may not have used DAO in your previous work, so that may not even matter.

    Frankly, there are so many ways to work with databases that when I am here, there are entire realms that I don't get into. If people are talking about datasources, tableadapters, and the wizard generated items, I move on to other things. While I could certainly figure those out, they aren't the way I am dealing with databases these days, so I have nothing to say about them. However, if those WERE the ways that I was dealing with databases, then I wouldn't need to be dealing with databases using any other means, as I am doing. So, it's almost a question of finding a technique that works for you and growing from there as needed.

    Perhaps the best solution would be no one tutorial, but try it out, then ask about specific pieces where it didn't work for you, or didn't make sense for you. That would be the most promising approach as it would lead to narrow questions about single topics.
    My usual boring signature: Nothing

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    This is the book I was talking about:

    http://msdn.microsoft.com/en-us/vstudio/ms788235.aspx

    If you want a listing of .NET types and members and what they do then that's the MSDN Library. Every type and member is documented.

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Cool Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Quote Originally Posted by jmcilhinney View Post
    This is the book I was talking about:

    http://msdn.microsoft.com/en-us/vstudio/ms788235.aspx

    If you want a listing of .NET types and members and what they do then that's the MSDN Library. Every type and member is documented.
    Thanks, that looks on-point and very applicable. At the very least, that should give me a framework for further study.

  12. #12

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Shaggy,

    I hear what you're saying, and I'm really not looking for an encyclopedia so much as a road map. Even something that just explained the relationship between the connection, the data source, the dataset, the datagrid, the datasuitcase, the datablender, the datakitchensink, Etc., -- that would be helpful.

  13. #13
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Quote Originally Posted by Og_ofthejungle View Post
    Shaggy,

    I hear what you're saying, and I'm really not looking for an encyclopedia so much as a road map. Even something that just explained the relationship between the connection, the data source, the dataset, the datagrid, the datasuitcase, the datablender, the datakitchensink, Etc., -- that would be helpful.
    You might try checking out these two CodeBank threads of mine:

    http://www.vbforums.com/showthread.p...a-in-Databases
    http://www.vbforums.com/showthread.p...An-Explanation

  14. #14
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,044

    Re: Seriously, a book suggestion on VB.NET changes from Classic...

    Quote Originally Posted by Og_ofthejungle View Post
    Shaggy,

    I hear what you're saying, and I'm really not looking for an encyclopedia so much as a road map. Even something that just explained the relationship between the connection, the data source, the dataset, the datagrid, the datasuitcase, the datablender, the datakitchensink, Etc., -- that would be helpful.
    The datasuitcase would be the List(of Object). The datablender just combines all the bytes together with XOR statements. The datakitchensink is where objects go after you have used them. Eventually, the datadishwasher, also known as the GC, will come along and clean them up.
    My usual boring signature: Nothing

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