January 20, 2021
Hot Topics:

Using Visual Studio Tools for Office in Visual Studio 2008

  • By M. Rajesh
  • Send Email »
  • More Articles »

Next, you will be asked to create a new document or use an existing document. Because you are going to import an existing template to this document, you will use this option. Select the second radio button and browse to the path of the template that I mentioned earlier (see Figure 4).

Click here for a larger image.

Figure 4: Select the second option, which allows you to reuse an existing template instead of creating a new blank document.

Click Finish to complete the initial stage; you now will be shown with the document inside of Visual Studio 2008, as shown in Figure 5. This is a new feature that allows the developer to preview and work with the document while writing code in .NET.

Click here for a larger image.

Figure 5: The Word document is previewed inside of your project in VS 2008; this is a new feature.

This completes the first part; the next part will create the panel to show the list of customers and bind them to the document. This requires that you understand the basics of Dataset, Table Adapter, and creating connections to a variety of data sources such as SQL Server 2005, SQL Express 2005, and MS Access. For this demo, you will be using SQL Express 2005 because it comes free and can be used on a desktop.

Now, create a typed dataset and refer that to the Customers table. This is because the first name, last name, Address, City, State, and Zip are all found in the Customers table.

Click the Server Explorer in Visual Studio 2008, right-click Data Connection, and click New Connection. This opens the Add Connection window, as shown in Figure 6. By now, most of you should be familiar with this because you have come across this in your development life cycle daily.

Figure 6: The Data Connection Wizard to establish a connection to the database and to be used in the Server Explorer.

Page 3 of 7

This article was originally published on April 28, 2008

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date