بیشترلیست موضوعات
• Table of Contents
• IndexSams Teach Yourself Visual Studio® .NET 2003 in 21 Days
By
Jason Beres
Publisher
: Sams Publishing
Pub Date
: January 14, 2003
ISBN
: 0-672-32421-0
Pages
: 696
Sams Teach Yourself Visual Studio .NET in 21 Days will help developers that are new to application development and experienced developers understand how to use the .NET Framework and Visual Studio .NET to rapidly develop any type of computer application. The Visual Studio .NET development environment is the most comprehensive developer tool ever created, putting that together with the .NET Frameworks' Class Libraries, the developer has everything he or she needs to get up-to-speed on Microsoft's latest revolution in application development. This book will guide the developer through using the VS .NET IDE, the Visual Basic .NET and C# language, and the supporting tools available from Microsoft to create Windows and Web-based applications. The market is full of books that pretty much say the same thing, which is already available in the help files, the author of this book has written and deployed over a dozen successful applications using Visual Studio .NET and the .NET Framework. All of his expertise and experience is used to give you the most comprehensive title on using Visual Studio .NET.
توضیحاتافزودن یادداشت جدید
Exercises
In the TestConsumer project you created earlier today, you didn't implement code for all the methods and properties you wrote in the myComponent Class Library application. Do the following to finish off the application:
In the Form_Load event, write code that calls the GetAuthors method and fill the DataGrid on the form with the results. This demonstrates how to pass ADO.NET data from a component to a client application.
In the DoName_Click event, add code that sets the FirstName and LastName properties and then display the FullName property in a MessageBox. This demonstrates how to set and retrieve properties in a component.
Create a new ASP.NET application with a DataGrid, a TextBox, and a CommandButton.Add a Class Library project to the solution. In the class library, create two methods with the following characteristics:
A GetAuthors method that retrieves all authors from the Pubs database. This method should return a SqlDataReader.
A GetAuthorByID method that takes the Au_ID field as a parameter to retrieve a specific author from the database. This method should return a SqlDataReader.
In the code-behind for the ASPX page that has the CommandButton and the TextBox, write code that fills the DataGrid with the results from the component based on the SqlDataReader that's returned.The goal of this exercise is to get you familiar with passing ADO.NET data to an ASP.NET application and using databinding with a data from a component. You might recall doing something almost exactly like this over the last few days, so reuse as much code that you've already written as you can.
Open the Visual Studio .NET SDK and do a search for walkthroughs. You should get to a screen that looks something like Figure 14.16.
Figure 14.16. Searching the SDK for walkthroughs.
To better understand the concept of creating instances of a component with the New keyword, do the "Authoring a Component with Visual Basic .NET" or the "Authoring a Component with Visual C#" walkthrough.If you're interested in creating controls for Web Forms or Windows Forms applications, the component authoring walkthroughs contain many great examples and information about taking the next step in component development.