Sharing the goodness…
Beth Massi is a Senior Program Manager on the Visual Studio team at Microsoft and a community champion for .NET developers. Learn more about Beth.
More videos »
Yesterday I posted the first 8 videos of the Visual Basic Forms over Data "How-to" video series on MSDN. These videos are for those who are just starting out with databases and Windows Forms data binding. I plan on continuing the series with more intermediate topics like custom object binding, adding validation and business logic, and how to manage requirements changes. What kind of topics are you interested in seeing here? Post a comment or drop me a line and let me know.
Those interested in the sample code I created in this series so far, see the attachment to this post.
In making the transition from being an expert Access programmer to a novice VB programmer this data series has been terrific. The VB code looks different than VBA code ... im still new to the Visual Studio scene and the most confusing thing to me is this SQL connection string. What is a connection string and if I make a database application using Visual Basic on my home pc will I have troubles implementing this onto a server at work? Thank you for taking the time to make this video series it has been very informative.
Thanks for the great feedback!
Unlike Access, the database file (MDF) is separate from your application (EXE), so a connection string is used to connect to the database. It's placed in your My.Settings (you can double-click on My Project in the Solution Explorer and select the Settings tab) when you create your DataSets.
When you use SQL-Server Express Edition, the database MDF file itself can be part of your project.
In that case, the MDF file is copied into your \bin folder with your EXE when you compile the application. The connection string will then contain |DataDirectory| in it which tells the connection object that the MDF file is sitting in the same place as the EXE.
If you copy the contents of the \bin folder to another machine first make sure you do not distribute the LDF file that is created on your machine (it will be in the same place as your LDF file). The connection string will not need to be changed if you use this technique. However, be careful not to overwrite an existing MDF file with the same name (if present), otherwise you will lose the data contained inside.
SQL-Express is ideal for a small number of users and it's free, but it needs to be installed (just like the .NET framework) when you install your application. However, as more and more people need access to your application, you can easily attach the MDF file to the full version of SQL-Server later which is much more scalable. At that point you would simply change the connection string to point to the database server. You can do this without recompiling the client EXE by modifying the .config file manually.
For an example, just take a look at the samples attached to this post.
Thank you for make these for community. I'm waiting for next video.
Beth, thanks very much for this video series! I'm an engineer who writes VB apps sometimes for my work. I've learned most of what I know from reading books and using the help system. I found your videos to be a much better and faster way to learn. Keep it coming!
In video 5 you showed the use of combo boxes for data entry in a grid. Suppose one of the products is discontinued, so you don't want to show it as an option for new orders. But you do want it to show up if you view a previous order. Is there a way to do that? I run into this problem all the time, for example with employee IDs where I want to offer only current employees as options for a field, but want existing records to display both current and non-current employees. Thanks!
Very well done. The series easily saved me a few weeks of pounding on the tools and docs to come up to speed on this.
From a newby's perspective, it would be nice to see it go all the way through to print/email/fax an invoice, statement, or PO.
Excelent videos. Keep them coming. I'm going from network Engineering to being a vb developer. I've bought about 6-7 books in the past few months. Some are horrible, some pare pretty decent. It's hard starting out from scratch cause it's a bit of a catch 22. You have to know so many things or order to learn other things. When you are a total newbie.. where to start.
Any video's would be appreciated. A lot of real world examples are great. Things like filtering combo boxes off other combo boxes. I'm Such a geek this stuff gets me excited.
Thanks for making these videos....they are great!
I watched them all last night and the videos are very easy to follow. I am looking forward to seeing more!
I never used more than one dataset in the past and I think that is why I have been having trouble getting my program to do what I want them to do, so thanks for showing that! I am working on a large program now that is going to require a strong database set-up, so these came just in time.
So - thanks again!
I have been in development for more than 20 years but had taken some time out round about the time .Net started coming in (approx 5 years ago). So here I am back working and playing catch-up ( as I am expected to build a multi-user care management system with SQL 2005 and VB 2005: - having been used to SQLv7 and VB6)
I found these tutorial videos quite by accident last week as I was searching for some help on .Net .....Beth if you stayed in Scotland I would take you for a slap-up meal. Catching up with the latest IDEs has never been so stress-free and easy... Well done!
Great videos beth...you just simplify what must i know. But i cant hear u voice on these videos. I used vista and play with windows media player 11, nothing wrong with my vista and i can play mp3 music.
I just watched the first four videos of the series and I had to stop to compliment you on them - you have an excellent teaching style and a pleasant voice!
Please make more.
Regarding the sound, you might want to try and download the videos as a zip file and extract them to your hard drive and then play them.
That's a common problem, I agree. I'll put together a sample (or blog post at least) with a solution soon.
Thanks for watching!
What a well constructed series. Heaps of praise. Looking forward to the next lot.
Just went through your video. It's really excellent.
As a newbie, I found it's really faster to learn from your video series compared reading through the books.
BUT, I found there maybe a problem in the Video #3 coding. I tried to delete the record using the "Customerbinding navigator" and save it. It gave me an error message "The DELETE statement conflicted with the REFERENCE constraint "FK_Orders_Customer". The conflict occurred in database "9FAEE0EF34E30C226D421BB5F0DCDAA6_TS\SELF\STUDY\VB\BETH'S\ORDERMANAGER\ORDERMANAGER3\ORDERMANAGER3\ORDERMANAGER\BIN\DEBUG\OMS.MDF", table "dbo.Orders", column 'CustomerID'.
The statement has been terminated."
Could you please tell me how to solve it?
This is how a database maintains referential integrity. The customer is not allowed to be deleted if there are orders. You will need to delete the orders before the customer can be deleted. You could set the referential integrity to CASCADE the deletes to the child tables but in this particular application that would be bad because we may have open orders or pending on the customer.