Abstract This sample shows how to edit data from a DataGridView in a details form which opens when one double clicks on the RowHeader of the DataGridView. Since both forms are bound to the same datasource one sees an instant update on both forms when the user decides to save the data and additional roundtrips to the database are avoided. It also provides a brief introduction to DataBinding in .NET.
Source Code Visual Basic | C#
Additional Resources Connecting to Data in Visual Studio Getting Started with Data Access Windows Forms Data Binding Forms over Data Video Series
Prerequisites The examples were created using Visual Basic 2008 Express (free download)/Visual C# 2008 Express (free download) but do also apply to earlier versions of Visual Studio (with minor modifications).
Enjoy!
Daniel
Abstract This short sample details how to access the clipboard to copy and paste text, images or generic objects. In order to do so this sample uses the Clipboard Class.
How Do I Video The corresponding How-Do-I video can be found here.
Additional Resources .NET Framework Class Library – The Clipboard Class
Prerequisites The examples were created using Visual Basic 2008 Express/Visual C# 2008 Express but do also apply to earlier versions of Visual Studio.
Thanks to the SQL Server Team we just released a free SQL Server 2008 Express How-To-Guide Series on msdev.com. During the next weeks we’ll also integrating parts of the series into the Visual Basic Developer Center, C# Developer Center, the Beginner Developer Learning Center, etc.
One video of the series: How do I query data in a database?
Given the fact that we don’t have unlimited resources (yeah, I know… that was the biggest surprise for me as well when I started working at Microsoft. “Where are all the bags with money standing around in each corner? What? There are none? D’oh!”) we tried to cover a pretty comprehensive area starting with basics like “How do I create a database?” over “How do I query data in a database?” to more advanced features like “How do I import data from another source (Excel, Access, XML, MySQL, ...) into a SQL Server Database?”.
Please let me know how you like the selection we made and if there are other topics you’d like to see*.
P.S.: We’ll rearrange the videos soon to have a nice walkthrough including “Topics you should know before watching this video” and “Next videos you might want to watch”.
* I don’t want to raise wrong expectations in that I’m promising other videos to show up on request but depending on the topic/amount of people requesting content we might extend the series.
I regularly check the forums to get an understanding what’s going on in the community and what’s troubling our customers. Based on my findings I created some videos including the corresponding source code which I’m releasing over the next couple of days and subsequently when things come up (and there is a lot out there :-))
Abstract This short video shows how to exchange data between two forms of a Windows Forms application. You'll see how to use 1.) a public method and 2.) a public property to exchange data.
Additional Resources Access Modifiers in Visual Basic Access Modifiers in C# Property Usage Guidelines
Prerequisites The examples were created using Visual Basic 2008 Express/Visual C# 2008 Express but do also apply to earlier versions of Visual Studio. Even though this concept is demonstrated in Windows Forms the same pattern can be used in WPF.
AbstractThis short sample demonstrates how to let one form in a Windows Forms application know when data in another form got changed. To implement this behavior I’ll show you how to create an event on Form2 and how to subscribe to this event on Form1 using the Handles keyword. The C# source code uses delegates to implement the aforementioned behavior.
Additional Resources Handling and Raising Events Events in Visual Basic
Prerequisites The examples were created using Visual Basic 2008 Express but do also apply to older versions of Visual Studio. Even though this concept is demonstrated in Windows Forms the same pattern can be used in WPF.