Sams Teach Yourself .Net in 21 Days
- Table of Contents
- Copyright
- About the Author
- About the Technical Editor
- Acknowledgments
- We Want to Hear from You
- Introduction
- Week 1: At a Glance
- Day 1. Introduction to the Microsoft .NET Framework
- Day 2. Introduction to Visual Studio .NET
- Day 3. Writing Windows Forms Applications
- Day 4. Deploying Windows Forms Applications
- Day 5. Writing ASP.NET Applications
- Day 6. Deploying ASP.NET Applications
- Day 7. Exceptions, Debugging, and Tracing
- Week 1. In Review
- Week 2: At a Glance
- Day 8. Core Language Concepts in Visual Basic .NET and C#
- Day 9. Using Namespaces in .NET
- Day 10. Accessing Data with ADO.NET
- Day 11. Understanding Visual Database Tools
- Day 12. Accessing XML in .NET
- Day 13. XML Web Services in .NET
- Day 14. Components and .NET
- Week 2. In Review
- Week 3: At a Glance
- Day 15. Writing International Applications
- Day 16. Using Macros in Visual Studio .NET
- Day 17. Automating Visual Studio .NET
- Day 18. Using Crystal Reports
- Day 19. Understanding Microsoft Application Center Test
- Day 20. Using Visual SourceSafe
- Day 21. Object Role Modeling with Visio
- Week 3. In Review
Exercise
Building on what you started yesterday with the code snippet macro, you're going to create an add-in that retrieves the data from SQL Server where the code snippets exist.
To do this, work through the following steps:
-
Create a new add-in project.
-
Add a new form to the add-in.
-
Add a ListView control to the form.
-
Add a Button control to the form.
-
On the Form_Load event, fill the ListView control with the data from the Utilities database in SQL Server where you're saving the code snippets from the macro you created yesterday.
-
When a user selects a code snippet from the ListView, add code to the Button that asks if the user wants to add the code to a tab in the Toolbox or a directory into the Code Editor.
-
Write code that inserts the code into either the Toolbox or into the Code Editor.
This form actually has only two methods with code: the Form_Load event and the Button_Click event that handle the interaction. You can get help while you're doing this by using what you learned today about the Toolbox object and by looking up the TextWindow object in Dynamic Help.
Day 18. Using Crystal Reports | Next Section

Account Sign In
View your cart