dcsimg
Results 1 to 12 of 12

Thread: Thoughts for an old Newbie?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2016
    Posts
    11

    Thoughts for an old Newbie?

    Hello All,

    The last time I developed a database application for myself I used VB6. As recently as a year ago I used MS Excel 2010 to query an Oracle Database and process 240,000 records.

    So now I'm trying to learn to build and work with databases in VB.NET. I've been struggling with it for quite some time. I've used books, online tutorials, and Youtube videos. Most start out with a detailed description of how to properly normalize a relational database. Then each source goes on to give a very nice application example which includes and queries ONE table. I've posted several times in MS' forums, some of the people genuinely try to help, others tell me to do something else, yet others wonder why I'm wasting my time with databases.

    In the past all my non-VBA programming has been a hobby. I've now become partially disabled and would like to supplement my income by creating applications for hobbyists.

    From the posts I've read on this website, you guys are well informed not only about .NET but the world outside .NET. I've always used books to establish a basic understanding of a new language or a new version. I have been VERY disappointed in the teaching materials available as well as their quality. I started reading about developing interfaces for applications to find out that MS considered Windows Forms obsolete and no longer supports them. Well, that's the first I heard of that. Seems pretty stupid to me that the "default" environment uses Windows Forms.

    I've gone through quite a bit of material on VB.NET, from "Hello World!" through discussions of all the different types of collections. When it comes to databases I'm having serious issues trying to understand how to work with a Dataset which contains multiple datatables with restrictions. I know that I'm supposed to use entity framework now but if I let some wizard do all the heavy lifting I learn nothing. Of course most of the resources I've seen for EF start with "it is assumed you have experience with Entity Framework".

    The VB6 application I created 100 years ago, installed, then asked the user where he wanted to create his first database. Then I created the JET database using code in the specified location with the specified name. If the user wished to have multiple databases for some reason all they had to do was select "create a new database". Of course I used the ancient Recordsets throughout.

    I'm getting ready to start a new EF tutorial at http://www.entityframeworktutorial.net/.

    Any pointers based on your learning? Any non .NET technology that might be more appropriate? I few years ago I wouldn't even have considered a non-MS product but after the disaster of Windows 8 I'm no longer all that loyal. I'm particularly interesting in sources to learn about EF and what I'm supposed to use now to create interfaces for users.

    Thanks,
    Chemist18

  2. #2
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,502

    Re: Thoughts for an old Newbie?

    I've got a few thoughts and the first one would be to step away from Entity Framework. It's a great technology and you're going to want to learn it down the line but, if you're coming from VB6 with knowledge and expectations around that, then there are much easier ways to ease yourself in.

    The first thing I'd do is learn some basic Database programming using ADO.Net. This is likely to be very similar to the sort of work you did in VB6 (assuming you used ADO) so should offer you a few quick wins. Get yourself to the point where you can retrieve some data from the DB, Display it, Edit it and Write it back. there are some pretty good tutorials stickied on this forum that will help you.

    Once you've done that you might want to play around with the data wizards in Visual Studio. These basically sit on top of the ADO.Net stuff and tie everything up for you. They're a fairly reasonable abstraction.

    Then dive into Entity Framework. By this point you'll have a much better understanding of .Net, the controls etc. and you won't be so readily distracted from your goal of learning EF.

    That's my two pennarth.
    FD

    PS Welcome to the forums. Be sure to tip your waiter.
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2016
    Posts
    11

    Re: Thoughts for an old Newbie?

    Quote Originally Posted by FunkyDexter View Post
    I've got a few thoughts and the first one would be to step away from Entity Framework. It's a great technology and you're going to want to learn it down the line but, if you're coming from VB6 with knowledge and expectations around that, then there are much easier ways to ease yourself in.

    The first thing I'd do is learn some basic Database programming using ADO.Net. This is likely to be very similar to the sort of work you did in VB6 (assuming you used ADO) so should offer you a few quick wins. Get yourself to the point where you can retrieve some data from the DB, Display it, Edit it and Write it back. there are some pretty good tutorials stickied on this forum that will help you.

    Once you've done that you might want to play around with the data wizards in Visual Studio. These basically sit on top of the ADO.Net stuff and tie everything up for you. They're a fairly reasonable abstraction.

    Then dive into Entity Framework. By this point you'll have a much better understanding of .Net, the controls etc. and you won't be so readily distracted from your goal of learning EF.

    That's my two pennarth.
    FD

    PS Welcome to the forums. Be sure to tip your waiter.

    Thanks ! I had pretty much arrived at a similar strategy. Apparently there are several interface tools (Blend and WPF, etc.)? Any suggestion?

  4. #4
    Fanatic Member cory_jackson's Avatar
    Join Date
    Dec 2011
    Location
    Fallbrook, California
    Posts
    976

    Re: Thoughts for an old Newbie?

    "A big round of applause for FunkyDexter, He'll be here all week."

    Chemist18 it's rare I get to contribute here as I too am a newb. I too recently got back into programming and chose VB.NET and am doing Db work. We have a lot in common. To date myself the last programming language I learned as an aspiring Mechanical Engineer in college was Pascal on a Digital VAX/VMS 8600.

    Funky is right, step back from EF. I did just about the same thing you did. There have been a series of ORMs and it seems MS keeps inventing a new one every 2 years and tells everyone the old stuff is crap despite them saying it was wonderful 2 years ago. I started with OLEDB, ADO and eventually went up to EF but starting with EF sucks in a way because it's so automated and assumes you're going to do things in a certain way. If I was teaching EF I would first teach people how to do SQLCommands, build tables, and all of that first. Then I would teach them how to create objects to make working with them more verbose and easier. Then I would tell them "You just made your own ORM!" Once you understand that then you realize all EF is, is a collection of wizards that write all that code for the objects you will use to interact for you in a very smart way. But at some point if you don't understand that you might be mystified as to how it all works.

    I also think EF is not appropriate for all tasks. I took some time off to get competent with EF in a simple way and then applied it to my big project. It was a mistake to do so due to the specialized nature of my program. EF is best when you have an application that will need a collection of related tables and Dbs in which you are frequently changing in crosswise fashion. In my case I was scraping data and pushing it over the fence. For this the whole EF thing was overkill and a lot of bloat and unnecessary code. I abandoned EF and went back to some simple SQL commands to push data and one ADO table. I even created a few of my own row objects so I could do a lot of validation and massaging of my data therein. However this is a rare case I think. Most times programmers will benefit from EF in a normal Db application. The next project I'm going to work on I plan on employing EF.

    Let me know if you would like to do that EF tutorial together. We could make a online study group.

  5. #5
    Fanatic Member cory_jackson's Avatar
    Join Date
    Dec 2011
    Location
    Fallbrook, California
    Posts
    976

    Re: Thoughts for an old Newbie?

    Also I too heard the "WinForms are dead" years ago. They even removed it from one of the VS versions but quickly put it back. Despite how MS wants us to change, WinForm applications will be around a long time I believe.

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2016
    Posts
    11

    Re: Thoughts for an old Newbie?

    Hey cory_jackson ,

    The similarity in our experiences seems to be right on .

    To date myself, I took a few classes in community college to learn BASIC and COBOL in 1983. When I finally went back to school I had to learn FORTRAN (1994ish). I taught myself to work with VBA in Excel in order to build automated Excel templates for recording laboratory work and data. I learned VB6 in order to create my own database for First Day Covers (related to stamp collecting).

    Since I'm not able to work like I used to I wanted to get up to speed with .NET in order to create applications that might generate me some income . I have two projects in mind, first is the database which will allow users to catalogue scanned pictures of their covers as well as samples of artist's marks/signatures. The second is more complex and involves building a shell around MS Excel to create a system that is 21CFR part 11 compliant. That has to do with proper handling of electronic records that will be used to support submissions to the FDA.

    When I learned VB6 I got all I needed to know from a single book (Beginning Visual Basic 6 Database Programming) combined with the Help that at that time was actually Helpful. What passes for Help at MS now is a reference, an important thing but not very useful for learning. One advantage to VB6 was I never even knew what Visual Studio was, I didn't need it .

    I've been extremely tempted to just use the recordset style of database access and not look back but if I'm gonna do it, I might as well do right . I don't care much for wizards. In fact I read an article recently titled "Why we don't hire .NET developers". The author compared .NET developers to people working at McDonald's. As long as there is an item in the freezer that's exactly the right size, you are good to go. If not you don't have the skills, knowledge and experience to resolve the situation. The author wasn't trying to be harsh even though it sounds that way.

    I will definitely give a shout if and when I start on the EF stuff. I finally found a paper by Microsoft from February 2002 with a discussion of how to deal with DataTables and DataRelations within a DataSet. It's titled Navigating Multiple Related Tables in an ADO.NET Dataset. I figure once I get through that I can step forward to newer versions...

  7. #7
    Fanatic Member cory_jackson's Avatar
    Join Date
    Dec 2011
    Location
    Fallbrook, California
    Posts
    976

    Re: Thoughts for an old Newbie?

    If you're going to work with Excel you might want to check out Excel.Interop.

    VS does makes some things easy and I'm sure as a result there are many people who don't know what is going on behind the scenes. But to some extent we're all like that. Everything we touch these days is a layer of abstraction. Everything that aids our productivity can also be a crutch.

  8. #8
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,191

    Re: Thoughts for an old Newbie?

    IMHO, working with Excel is more a PITA than working with databases so you should get going with dbs soon enough. See this recent topic on closing Excel as an example. I had used KarenInstructor's method since that was the best I found at the time. Next time I'll use TnTinMN's advice (post #9) to KISS.

    Anyway, I think either the FAQ in this forum or JLM's thread will get you going in ADO.Net. The beauty of that is unless you're doing some odd SQL, it doesn't matter what backend you use, you can switch between dbs with minimal change. I have yet to do anything with EF. Maybe it's a mistake for me not to use it, but I haven't seen the need yet. I have used Oracle, SQLite and MySQL for the backend in ADO.Net so far.

    Make sure you use parameters (preferably specifying the data type) to prevent SQL injection.

  9. #9

    Thread Starter
    New Member
    Join Date
    Oct 2016
    Posts
    11

    Re: Thoughts for an old Newbie?

    Thanks for your responses .

    I'm still searching around looking for enough information to "learn" my way through communicating with a database from VB.NET. So far I've found many tutorials and demos that give one or two aspects but fail to connect to the rest, they usually do it in a way that makes the explanation incompatible with other explanations.

    This whole process feels like MS doesn't want people to understand what they are doing, they just want you to use "wizards"?

    It's as if I were to give you all the components for a High Performance Liquid Chromatograph (HPLC) and say,

    Parts:
    (A) degasser
    (B) pump
    (C) column heater
    (D) detector

    Method for Separation of compound X and its impurities
    Column: X-Brand C-18, 4.6 mm x 15 cm, 3.0 m
    Flowrate: 1.0 mL/min
    Wavelength: 210 nm
    Injection Volume: 10 L
    Column Temp: 40C

    Mobile Phase A: 40% 10 mM pH 7 Phosphate Buffer / 60% Methanol
    Mobile Phase B: 20% 10 mM pH 7 Phosphate Buffer / 80% Methanol

    Gradient Profile

    Time.......%A......%B
    (min)
    00.00.....100.......0
    01.00.....100.......0
    15.00.......0.....100
    16.00.......0.....100
    20.00.....100.......0


    Now connect (A) to (B) to the Column to (C) to (D). Now use the handheld controller to program your instrument with injection volume, column temperature, flowrate, gradient profile.
    (by the way those aren't the conditions for any method I know of)

    There, now you should have no problem developing a set of conditions to separate compound Y and all of it's impurities. Regardless of how much you know about the Buffer capacity of pH 7 10 mM phosphate buffer, Ion pairing, hydrophobic vs hydrophilic chemical structures, the effect of temperature on the viscosity of Water/Methanol mixtures unless you've developed methods from scratch before you are shooting in the dark.

    My point is that the level of understanding required to follow a prescribed, detailed method is completely different from the level of understanding required to develop one of those methods on your own. Pardon my using this as an example but it's the only thing I could think of quickly that had enough variables .

  10. #10
    Fanatic Member cory_jackson's Avatar
    Join Date
    Dec 2011
    Location
    Fallbrook, California
    Posts
    976

    Re: Thoughts for an old Newbie?

    I wish I could link you to what I learned ADO on. I used a book "Teach yourself VB.NET in 24 hours" and it was very simple and it made a lot of sense. But I tend to create my tables in SSMS and then use the Data Designer. But in there you can see the SQL commands it uses to fill and such interactively. But also you can just do it manually if you like. Anyway I agree with you that most of this comes in from a higher level. I'm guessing you are like me and would rather learn the nuts and bolts then work your way up. Otherwise it's all mysterious. After I learned my first functional bit of EF then I realized the basic concept of ORM. In fact I had, in a sense, made my own at that point without realizing it. Once I saw how it generates objects that represent the entities I realized the benefit. But like most things I had to trudge though this higher level while only half understanding the concepts of what they were talking about. Right now I wish I could have gone back in time and set myself down and said "You know how you can make a class that represents a row of data? Well that's yada, yada, so forth and so on." I think I could have made everything much easier in about 30 seconds of explanation to myself. But I don't know where one finds those explanations online. And it's all on the MSDN... somewhere. But the MSDN is encyclopedic and explains every single aspect of the technology in painfully time consuming detail. My experience is you either get a thick technical manual or a tiny marketing procure. Both functionally useless. :-) So I feel your pain.

  11. #11

    Thread Starter
    New Member
    Join Date
    Oct 2016
    Posts
    11

    Re: Thoughts for an old Newbie?

    LOL. You are just like me. Back when we still used 5 1/4" diskettes and computer with 32 KB of memory I was normalizing my databases without realizing it. I just kept squeezing until my programs would fit .

    I'll get this, I just have to work past the frustration blocks.

  12. #12
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,502

    Re: Thoughts for an old Newbie?

    If you want good ADO.Net tutorials see here and here. Both great tutorials written by members of this forum. Also, go to the stickies at the top of the database section and check out the database faqs thread - you'll find a bunch of good tutorial for a bunch of different technologies and approaches.

    This whole process feels like MS doesn't want people to understand what they are doing, they just want you to use "wizards"?
    Yes and no, I think. there are two things that abstract away expertise (Wizards and Frameworks) and MS does tend to champion them both

    The wizards are there to help ease people who don't know what they're doing into the technology but they do expect you to start lifting the lid before too long. Admittedly, some programmers never bother, but that doesn't mean you can't or shouldn't.

    The frameworks, e.g. entity framework are intended to make you more productive by making common tasks quick to carry out. They're not meant to close any kind of knowledge gap and they're written with the assumption that you understand the subject matter well enough to leverage the framework well. Unfortunately, a lot of folks tend to grab frameworks as a shortcut to learning and, as a result, produce some really horrible stuff. EF is a good example of that and has a bad name in the industry as a result. Lots of folks have used it to produce really bad database designs and really non-performant queriesm but that doesn't mean it can't produce really good designs and really good queries. But you still have to know what a good design looks like first.
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width