Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



SSWUG


XAMALOT
 


CODE Training

Reader rating:
Click here to read 2 comments about this article.
Article source: CoDe (2007 - Vol. 4 - Issue 1 - Sedna: Beyond Visual FoxPro 9 )


Article Pages:  1  2 3 - Next >


The New and Improved Data Explorer

The Data Explorer introduced in VFP 9.0 allows developers to work with different types of data from diverse data sources independent of specific projects. The Sedna update extends this already powerful and productive tool.

The Sedna release of the Data Explorer adds new features and corrects some recognized bugs. Each of the enhancements and improvements came from suggestions made by the Fox Community, problems submitted to Microsoft, and at least one bug fix came directly from code blogged with the correction.

"
The toolbar buttons of the Data Explorer now mimic the functionality as well as the look and feel of the Server Explorer inside of Visual Studio .NET.
"

The changes discussed in this article are based on the version shipped in the Sedna October 2006 Community Tech Preview (CTP) and some additions made just after the CTP release. You can download the Sedna components from Microsoft’s Visual FoxPro Web site (http://msdn.microsoft.com/vfoxpro/). It is important to note that at the time this article was written, Microsoft has not finalized the features to be included in the gold release.

Data Explorer Main Form

One change you immediately notice is the buttons on the top of the main form seen side-by-side in Figure 1 with the newer version on the right. The toolbar buttons of the Data Explorer now mimic the functionality as well as the look and feel of the Server Explorer inside of Visual Studio .NET. You can use the new Refresh button to update the contents of the tree view. This feature is available using the Data Explorer shortcut menu even in the original version. In addition, you’ll use the Refresh button when you make changes to the schemas in a database, or you have multiple copies of the Data Explorer open and make changes to the connections in another instance and you want to update the current instance of the Data Explorer. You can optionally include the icons and make the toolbar buttons hot tracking. These two settings are available on the Options dialog box and discussed later in this article.

Click for a larger version of this image.

Figure 1: One of the enhancements to the Sedna version of the Data Explorer (shown on the right side) is to the toolbar at the top of the main form. One of the bugs fixed is the default values (highlighted in the description pane) now show the setting correctly for VFP tables.

Microsoft enhanced the main form so the treeview nodes no long collapse when you return to the Data Explorer window from the Options dialog box. This saves time when you make code changes to the various extensions like the shortcut menu, drag and drop functionality, or the query add-ins. You now jump directly to the node you are using to test the changes instead of having to drill down every time you return to the Data Explorer.

The original version of the Data Explorer allows you to sort objects for each connection. Turning on this setting will sort all the tables, views, and stored procedures by name. Unfortunately, this setting also sorts the column names by name. Most developers want the tables, views, and stored procedures sorted, but prefer the column names in natural column order. The Sedna Data Explorer allows you to choose how you want the column names ordered for VFP and SQL Server connections separate from the object sorting setting. This is one of my favorite enhancements. Microsoft enhanced the property dialog boxes for these connections (Figure 2) so you can make your preferences more granularly than the original version of the Data Explorer.

Click for a larger version of this image.

Figure 2: You can now sort objects without sorting column names because Sedna splits out the two options for VFP and SQL connections.

Shortcut Menu

You’ll find most of the Data Explorer functionality on the shortcut menu for the treeview. Sedna has several new features that don’t automatically show up on the menu if you’ve previously used the Data Explorer because the functionality for the shortcut menu is stored in the metadata: DataExplorer.DBF in the HOME(7) folder. The new functionality is stored inside the DataExplorer.APP file internally in a DBF file. If you want the new menu functionality and want to retain your existing connections and extensions you have added or downloaded you need to use the Options dialog box to update your DataExplorer.DBF metadata.

From the Data Explorer toolbar click Options and then find the button called Restore to Default. You might hesitate thinking that this option might set your Data Explorer back to the factory settings, and indeed this is possible, but you can also retain the connection settings and the extensions you have added to the menu, to the Run Query dialog box, and the drag and drop functionality. Click Restore to Default to start the update process. You’ll see this message: “Do you want to maintain connections and customizations that were done by you or a third-party vendor?” Click yes if you want to save your changes and get the new enhancements. Click no if you really want to reset your installation to factory settings including the new functionality distributed by Microsoft in the Sedna release. Note that if you made any enhancements to the code included in the original Data Explorer features, it is possible the Data Explorer will reset it. See the sidebar, Update Shortcut Menu Can Overwrite Your Code Changes, for more details and recommendations.

SQL ShowPlan

Another feature that Sedna adds to the shortcut menu will display the SQL ShowPlan (Figure 3) for local views. Besides the actual ShowPlan details, the results include:

Click for a larger version of this image.

Figure 3: One of the new shortcut menu items for local views is to display the SQL ShowPlan to analyze the Rushmore optimization for the query. The results are displayed in the FoxPro text editor.

  • The ShowPlan level passed to the SYS(3054) function
  • SQL-SELECT code stored in the local view
  • How long the query ran in seconds
  • Number of records returned from the query
  • View parameter(s) and their data types
  • Optional messages to indicate how slow the query ran based on your threshold preferences
  • Date and time the analysis was completed

One aspect of the ShowPlan output you can customize in the code is the threshold of when a view is considered moderately slow, just plain slow, super slow, or critically slow. Each of these thresholds can differ between developers. You can change these #DEFINEs to meet different localization requirements.

#DEFINE cnCRITICALSLOW          60.0
#DEFINE cnSUPERSLOW             20.0
#DEFINE cnSLOW                  10.0
#DEFINE cnMODERATESLOW           4.0
#DEFINE ccCRITICALCAPTION       "Critical Slow"
#DEFINE ccSUPERSLOWCAPTION      "Super Slow"
#DEFINE ccSLOWCAPTION           "Slow"
#DEFINE ccMODERATESLOWCAPTION   "Moderate Slow"

Visual FoxPro determines the ShowPlan for a view when it opens or requeries a view. One of the tricky parts of writing generic code to open a view is to deal with the possibility of view parameters. The script code for this feature looks at the view parameter list for the view and places empty values based on the data type of the view parameter if this is set. If you haven’t added the view parameters to the parameter list in the View Designer, in your view script code (if you are avoiding the View Designer), or by your favorite view editor, VFP will prompt you to enter in the value when the view is opened. This will artificially slow down the performance of the view, but will not affect the ShowPlan details.

&

By: Rick Schummer

Rick Schummer is the president and lead geek at White Light Computing, Inc. headquartered in southeast Michigan, USA. He prides himself in guiding his customer’s information technology investment toward success. He is a co-author of Visual FoxPro Best Practices for the Next Ten Years, What’s New in Nine: Visual FoxPro’s Latest Hits, Deploying Visual FoxPro Solutions, MegaFox: 1002 Things You Wanted To Know About Extending Visual FoxPro, and 1001 Things You Always Wanted to Know About Visual FoxPro. He is regular presenter at user groups in North America and has enjoyed presenting at GLGDW, Essential Fox, VFE DevCon, Southwest Fox, German DevCon and Advisor DevCon conferences. You can find all of his developer tools at his company Web site: http://whitelightcomputing.com.

raschummer@whitelightcomputing.com

Fast Facts

The Sedna Data Explorer provides numerous enhancements and essential bug fixes to a tool introduced in VFP 9.0. This article highlights the new changes made to the Data Explorer so developers can be more productive managing and querying VFP, SQL Server, Oracle, and any other data source you can connect to using OLE DB through ADO.



Article Pages:  1  2 3 - Next Page: 'Database Documenter' >>

Page 1: The New and Improved Data Explorer
Page 2: Database Documenter
Page 3: Options Dialog Box

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
3.8 out of 5

17 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      Sharepoint TechCon

 

DevTeach