Developer .NET UPDATE—brought to you by Windows & .NET Magazine Network.
http://www.winnetmag.net


THIS ISSUE SPONSORED BY

DevConnections .NET Tour

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:
http://www.devconnections.com/tour


November 5, 2002—In this issue:

1. DEVELOPER .NET PERSPECTIVES

  • Debugging the Database

2. ANNOUNCEMENTS

  • Attend Our Free Tips & Tricks Web Summit
  • Give Us Your Feedback and Be Entered to Win a Digital Camera

3. RESOURCES

  • 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, bills@interknowlogy.com)

  • DEBUGGING THE DATABASE

  • 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!
    http://www.sqlmag.com/sub.cfm?code=mlei322jdn


    2. ANNOUNCEMENTS
    (brought to you by Windows & .NET Magazine and its partners)

  • ATTEND OUR FREE TIPS & TRICKS WEB SUMMIT

  • 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!
    http://www.winnetmag.com/seminars/tipstricks

  • GIVE US YOUR FEEDBACK AND BE ENTERED TO WIN A DIGITAL CAMERA

  • 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!

    3. RESOURCES

  • LEARN ABOUT THE WEB MATRIX

  • 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
    http://www.sqlmag.com/articles/index.cfm?articleid=26548

  • HOW TO CONVERT a .VBS FILE INTO AN .EXE OR .DLL FILE

  • 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
    http://www.winnetmag.com/forums/rd.cfm?cid=43&tid=49010

    4. NEW AND IMPROVED
    (contributed by Sue Cooper, products@winnetmag.com)

  • EXTEND AND INTEGRATE LEGACY APPLICATIONS

  • 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.
    http://www.clientsoft.com

    5. CONTACT US
    Here's how to reach us with your comments and questions:

    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.
    http://www.winnetmag.com/sub.cfm?code=wswi201x1z

    Receive the latest information about the Windows and .NET topics of your choice. Subscribe to our other FREE email newsletters.
    http://www.winnetmag.net/email