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 »
I just uploaded more videos to Microsoft Downloads! I wanted to post the direct links here and the matching code downloads for all of you immediately even though MSDN will be creating a pretty landing page like this one for them this week, probably tomorrow or Wednesday. (I'll update this post when that's up).
Download the Forms over Data Video Series #2 and the associated code now!
Hi Beth, your video 5CreatingLookupLists.wmv is extremely useful!
I have parent table "Orders" related to child table "OrderDetails" just like in your example. So I have an "OrderDetails" node under "Orders" node.
But I have another parent table "Currencies", which is also related to child table "OrderDetails". So I have another "OrderDetails" node, this time under "Currencies" node.
Which "OrderDetails" node should I drag to my form - the top one, the one under "Orders" or the one under "Currencies"?
It depends how you want the relation to work but I suspect in the UI that you'll want to relate the OrderDetails to the Orders, so you'd drag the OrderDetails under the Orders node. This way when the position moves in the Orders table, the OrderDetails will automatically filter for you.
First of all, your FOD videos are great and have helped me tremendously. I to have the same similar problem as "Steven" had asked you about June of this year. I know this sounds pretty simple but I've checked all over the internet trying to figure this out. When I add a report viewer control to my form, I get no response when I select "Design a new report". I did notice that "new report" is not an option when I select add new item from my project. Is there some reference that I may be missing? Any help you could provide would be greatly appreciated.
Beth, I have watched some of your videos. In reality, you will want to create say an application where the user enters data into say textboxes and then presses Save for it to save the data into a database and not the drag and drop thing in the videos. Do you have in mind coming up with such videos?
All the drag and drop does is set up the BindingSources for you automatically. You have to do this same process if you do it manually. You can drop textboxes by selecting the table's drop-down from the DataSources window and selecting "Details" instead. You can also just design the form yourself and then drag the fields onto the top of the existing controls to set up the data binding.
May I post a question? I imported an Access database into VB Express. I'm going pretty well, created a parent form with child table. I have relationships set up many-to-one, with ID keys. My problem is that I'm starting with a blank child table, enter information but the key isn't automatically updated to reflect the parent ID. Isn't it supposed to? Or is there something I need to do when exiting the row to update the Key field from the parent ID? If so, can you direct me to a coding example? Much appreciation in advance. -Doug
HAI BETH. A VERY NICE VIDEO SERIES
I HAVE FEW QUESTIONS FOR YOU.
1. I HAVE CREATED AN APP BY DRAG 'N DROP AS IN YOUR VID. HOW DO I KNOW IF THERE IS A DOUBLE DATA IN PRIMARY KEY COLUMN AFTER INPUTING NEW DATA. WHAT I MEAN IS WITH WHICH ROW (DATAGRIDVIEW). I USED TRY -CATCH CODE BUT IT DOESN'T SHOW WHICH ROW.
2. WHILE USING MS. ACCESS AS DB, I SEE THERE ARE 2 *.MDB INSIDE AND OUTSIDE THE BIN FOLDER, SO WHERE MY CURRENT DB IS. BECAUSE OF THAT, I HAVE DIFFICULTY IN ADDING A NEW COLUMN I MY TABLE, FOR EXAMPLE.
3. PERHAPS YOU ARE WILING TO CREATE A NEW VIDEO: HOW TO IMPORT/EXPORT DATA IN EXCEL, WORD OR TEXT FILE.
FROM THE DEEPEST IN MY HEART.....(@#&*), I HOPE YOU ANSWER MY QUESTIONS.
KEEP MOVING & GOD BLES YOU.
When you set up the related BindingSources this will automatically be taken care of for you. Here's a video on how to set up related tables: http://msdn2.microsoft.com/en-us/vbasic/bb643827.aspx?wt.slv=topsectionsee
And here's on on how to save them: http://msdn2.microsoft.com/en-us/vbasic/bb725826.aspx?wt.slv=topsectionsee
I'd also watch this one too for reference: http://msdn2.microsoft.com/en-us/vbasic/bb725824.aspx?wt.slv=topsectionsee
Re #1. I don't think I understand your question. If you're asking about validation you can watch this video to get started: http://msdn2.microsoft.com/en-us/vbasic/bb643821.aspx
Re #2: Read this post, it also applies to access databases: http://blogs.msdn.com/bethmassi/archive/2007/05/29/working-with-a-local-data-file-in-vs.aspx
Re #3: I recently wrote 2 articles on that and also have a video:
IT'S NICE TO KNOW YOU RESPONSE MY QUESTION.
1. ABOUT MY 1ST QUESTION, I DIDN'T TALK ABOUT A VALIDATION. FOR EXAMPLE, I HAVE 50 ROWS/DATA IN A DATAGRIDVIEW AND I INPUT A NEW DATA/ROW WHICH IS SAME WITH DATA IN MY PRIMARY KEY COLUMN (REDUNDANCY). AUTOMATICALLY THE NEW ROW WILL BE REJECTED EVEN IF I HAVEN'T USED VALIDATION CODES. MY QUESTION IS WITH WHICH ROW IN DATAGIDVIEW MY DATA IS DOUBLE.
2. ABOUT THE 2ND QUESTION, I STILL LEARN YOUR VID/ARTICLE. ANYWAY THANKS.
3. THE 3RD ONE, I AM VERY APPRECIATE YOUR VID/ARTICLES. HOWEVER, I STIL USE VS 2005. FOR ME THE DEVELOPMENT OF VS IS TOO FAST TO UNDERSTAND BUT I RESPECT MICROSOFT FOR THE INOVATION. RIGHT NOW I WILL STILL USE VS 2005 BUT I WILL USE VS 2008 IN THE FUTURE.
KEEP MOVING & GOD BLES YOU
First congrats on your video series. They helped me a lot understanding vb2005/2008 (I come from an ancient environment and it really helped me migrating). Keep up the good work.
But I have a question. I have an MDI form application. The user opens one form for updating/adding customers in a customertable.
The user clicks on another forms viewing orders per customer (kind of like your lookup example).
When they changed the adress in the update form, what's the best way to receive this adress modification the orderlookup form ?
Should I rebuild the dataset in the orderlookup form ?
Should I make it shared among the forms and load it in the MDI form ?
Could you give me some example code ?
Thanks for your reply
I hope you can help resolve this problem.
I have 2 tables: Clients and Orders
I have a datagridview associated to the Clients table.
In the load function of the form, I fill a table adapter with the clients table. I don't fill a table adapter with the orders table. The reason is because I don't need to visualizze this information in this form.
The client code in the Clients table is a foreign key in the Orders table.
I'm having trouble deleting a row from the datagridview because of the foreign key relation to the Orders table. Must I have to load all the tables that have a foreign relationship to the clients table before I delete the row from the client data set table and call update on all the related tables (ie. order table).
The error message is:
DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_TAB_FATTURE_TAB_CLIENTI'. The conflict occurred in database 'testWindowsForm', table 'TAB_FATTURE', column 'cod_cliente'.
I hope you can help!
You need to always delete the children before you delete the parent in the database otherwise you will get this error. This is how a database enforces referential integrity. So you need to load the children of the parent records you select and perform an ordered update (see this article for 2005: http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx and this one for 2008: http://blogs.msdn.com/bethmassi/archive/2008/01/07/the-new-tableadaptermanager-in-visual-studio-2008.aspx) or you can set the CASCADE delete behavior on the database itself it that makes sense for your scenario.
Take a look at this post: http://blogs.msdn.com/bethmassi/archive/2007/10/01/using-data-across-multiple-windows-forms.aspx
Hi Beth !
This Has Been A Great Help Towards Your Side.
Really ... You Have Done A Great Job Overall ,