Developer .NET UPDATE—brought to you by Windows & .NET Magazine Network.
THIS ISSUE SPONSORED BY
SQL Server Magazine
(below DEVELOPER .NET PERSPECTIVES)
SPONSOR: DEVCONNECTIONS .NET TOUR
DevConnections is bringing its events to you. Three in-depth tracks covering ASP.NET, Visual Basic .NET, and Visual C# .NET. Stay in one track all day or float from session to session across tracks. Attend Day 1 or Day 2 as single seminars or maximize your learning and Q&A time by attending both days.
Join industry gurus Paul Litwin, Ken Getz, and Richard Hale Shaw for these power-packed seminars. Don't let a lean travel budget prevent you from keeping your competitive edge as a developer. Register now for a city near you:
November 5, 2002—In this issue:
1. DEVELOPER .NET PERSPECTIVES
- Debugging the Database
- Attend Our Free Tips & Tricks Web Summit
- Give Us Your Feedback and Be Entered to Win a Digital Camera
- Learn About the Web Matrix
- Featured Thread: How to Convert a .vbs File Into an .exe or .dll File
4. NEW AND IMPROVED
- Extend and Integrate Legacy Applications
5. CONTACT US
See this section for a list of ways to contact us.
1. DEVELOPER .NET PERSPECTIVES
(contributed by Bill Sheldon, email@example.com)
This week, I want to discuss a subject that's near and dear to every developer's heart: debugging. In general, debugging in Visual Studio .NET is similar to debugging in Visual Studio (VS) 6.0—you use a point-and-click interface to set breakpoints in your code. Although this basic interface hasn't changed dramatically from VS 6.0, Visual Studio .NET has one new debugging feature with which most developers aren't familiar: the ability to debug stored procedures in Microsoft SQL Server projects.
Were you ever certain that your SQL Server code would work because you used the debugger to step through all the code, but then the code failed when you executed your statement against the database? Unfortunately, all you have at that point is an error code returned from a stored procedure that has several dozen embedded commands. With the .NET debugger, you can now debug stored procedures from Visual Studio .NET. Just as you can step from Visual Basic .NET code to Visual C# .NET code, you can step from Visual Basic .NET code into the T-SQL commands that make up your stored procedures.
To debug stored procedures, you need to take a few steps beyond having your project in Debug mode and clicking in the margin to add the red circle that indicates the placement of a breakpoint in the code. The first step is to enable the SQL Server debugger within the project's properties. In Solution Explorer, right-click the project name and select Property Pages to open the project's Property Pages dialog box. On the right side is a list box that contains the major categories (e.g., Common Properties, Configuration Properties) of the properties for the project. Select Configuration Properties. The debugging properties appear by default. The properties include a variety of settings for how to start the project and a list of the available debuggers. By default, the SQL Server debugger in this list isn't active. To enable SQL Server debugging, select SQL Debugging and save your selection by clicking OK.
At this point, you can debug stored procedures. However, unlike the code debugger, which lets you step directly into another function even in a different implementation language, the SQL Server debugger requires you to have a breakpoint in the procedure. To set this breakpoint, you need to use Server Explorer, which you can access by selecting the Server Explorer tab on the left side of the Visual Studio .NET window. Server Explorer lets you define new data connections. Right-click Data Connections and select Add Connection. A good sample connection to create is to the sample Northwind database that ships with SQL Server. So, in the Connection dialog box, select your SQL Server machine, define an account, then select the Northwind database. Click OK to exit.
After you've added a new connection to Server Explorer, expand that new entry to access the database's details. Server Explorer lets you expand the list of available tables, examine and create database diagrams, and carry out various actions related to managing your database. For this exercise, expand the Stored Procedures category and double-click the stored procedure associated with the sample database. The stored procedure's text will appear in Visual Studio .NET's main edit window.
Once the stored procedure is open in the Visual Studio .NET editor, click in the margin to add a breakpoint. Then, execute your application (i.e., a Windows form or ASP.NET Web form). When the application executes the stored procedure, the debugger will stop in the stored procedure at your breakpoint. At that point, you can begin stepping through the statements that make up your stored procedure and even examine the local SQL variables in the Command window.
Visual Studio .NET provides both a powerful code editor and an integrated debugging environment for application code and database logic. The Visual Studio .NET debugger contains several powerful capabilities, including making breakpoints occur conditionally or only after a given number of executions if the breakpoint is within a loop. As a .NET developer, you'll want to investigate all of the .NET debugging capabilities so that you can take full advantage of them.
SPONSOR: SQL SERVER MAGAZINE
REGISTRATION DEADLINE - NOVEMBER 8TH!
Join Morris Lewis, Tues., Nov. 12, for a special one-hour presentation, "Designing SQL Server Security for .NET," brought to you by SQL Server Magazine. Learn how to adapt SQL Server security to support truly distributed applications. Tap into Morris Lewis' programming, network administration, database administration, and training expertise. Click here!
(brought to you by Windows & .NET Magazine and its partners)
Join us on December 19th for our Tips & Tricks Web Summit featuring three eye-opening events: "Disaster Recovery Tips & Tricks," "Intrusion Detection: Win2K Security Log Secrets," and "Merging Exchange Systems: Tips for Managing 5 Key Challenges." There is no charge for this event, but space is limited so register today!
Internet filtering is becoming a financial and legal concern for companies of all sizes. Complete our brief survey about the topic and you could win a digital camera. Click here!
Web Matrix, a free download that includes a subset of Visual Studio .NET's development features, is a great way to get your feet wet using ASP.NET without shelling out the money for a full copy of Visual Studio .NET. To learn more, go to
If you want to learn what you can and can't use to convert a VBScript file into an executable or DLL file, go to
4. NEW AND IMPROVED
(contributed by Sue Cooper, firstname.lastname@example.org)
ClientSoft released ClientBuilder for Visual Studio .NET, a development tool that lets programmers build IBM mainframe enterprise applications and IBM AS/400 host-based applications without any knowledge of legacy programming languages. ClientBuilder accomplishes this feat through tight integration with Visual Studio .NET and wizard-driven tools that shield developers and users from the legacy systems' complexity. ClientBuilder's features include automatic generation and maintenance of code, dynamic-session pooling, disconnected playback mode, and extensibility to all the .NET supported languages. Base pricing starts at $89,000. ClientBuilder for Visual Studio .NET works on Windows XP Professional Edition, Windows 2000, and Windows NT. Visual Studio .NET is required. Contact ClientSoft at 305-716-1007 or http://www.clientsoft.com/contact.htm.
5. CONTACT US
Here's how to reach us with your comments and questions:
- ABOUT DEVELOPER .NET PERSPECTIVES — email@example.com
- ABOUT THE NEWSLETTER IN GENERAL — firstname.lastname@example.org
(please mention the newsletter name in the subject line)
- TECHNICAL QUESTIONS — http://www.winnetmag.net/forums
- PRODUCT NEWS — email@example.com
- QUESTIONS ABOUT YOUR DEVELOPER .NET UPDATE SUBSCRIPTION?
Customer Support — Developer_dot_NET_update@winnetmag.com
- WANT TO SPONSOR DEVELOPER .NET UPDATE?
This weekly email newsletter is brought to you by Windows & .NET Magazine, the leading publication for Windows professionals who want to learn more and perform better. Subscribe today.
Receive the latest information about the Windows and .NET topics of your choice. Subscribe to our other FREE email newsletters.