Archives

Archives / 2003 / October
  • Faster than speeding light!

    Want to achieve it ? (In SQL Query Analyzer)...from MSDN documentation.

    Activity Shortcut
    Bookmarks: Clear all bookmarks. CTRL-SHIFT-F2
    Bookmarks: Insert or remove a bookmark (toggle). CTRL+F2
    Bookmarks: Move to next bookmark. F2
    Bookmarks: Move to previous bookmark. SHIFT+F2
    Cancel a query. ALT+BREAK
    Connections: Connect. CTRL+O
    Connections: Disconnect. CTRL+F4
    Connections: Disconnect and close child window. CTRL+F4
    Database object information. ALT+F1
    Editing: Clear the active Editor pane. CTRL+SHIFT+DEL
    Editing: Comment out code. CTRL+SHIFT+C
    Editing: Copy. You can also use CTRL+INSERT. CTRL+C
    Editing: Cut. You can also use SHIFT+DEL. CTRL+X
    Editing: Decrease indent. SHIFT+TAB
    Editing: Delete through the end of a line in the Editor pane. CTRL+DEL
    Editing: Find. CTRL+F
    Editing: Go to a line number. CTRL+G
    Editing: Increase indent. TAB
    Editing: Make selection lowercase. CTRL+SHIFT+L
    Editing: Make selection uppercase. CTRL+SHIFT+U
    Editing: Paste. You can also use SHIFT+INSERT. CTRL+V
    Editing: Remove comments. CTRL+SHIFT+R
    Editing: Repeat last search or find next. F3
    Editing: Replace. CTRL+H
    Editing: Select all. CTRL+A
    Editing: Undo. CTRL+Z
    Execute a query. You can also use CTRL+E (for backward compatibility). F5
    Help for SQL Query Analyzer. F1
    Help for the selected Transact-SQL statement. SHIFT+F1
    Navigation: Switch between query and result panes. F6
    Navigation: Switch panes. Shift+F6
    Navigation: Window Selector. CTRL+W
    New Query window. CTRL+N
    Object Browser (show/hide). F8
    Object Search. F4
    Parse the query and check syntax. CTRL+F5
    Print. CTRL+P
    Results: Display results in grid format. CTRL+D
    Results: Display results in text format. CTRL+T
    Results: Move the splitter. CTRL+B
    Results: Save results to file. CTRL+SHIFT+F
    Results: Show Results pane (toggle). CTRL+R
    Save. CTRL+S
    Templates: Insert a template. CTRL+SHIFT+INSERT
    Templates: Replace template parameters. CTRL+SHIFT+M
    Tuning: Display estimated execution plan. CTRL+L
    Tuning: Display execution plan (toggle ON/OFF). CTRL+K
    Tuning: Index Tuning Wizard. CTRL+I
    Tuning: Show client statistics CTRL+SHIFT+S
    Tuning: Show server trace. CTRL+SHIFT+T
    Use database. CTRL+U

  • Joys of ASP.NET 2.0 - Series - Part 2 from PDC

    excerpt from Bill's Notes

    Rob Howard – WSV330 – ASP.NET Programming Using Advanced Caching Techniques in ASP.NET Whidbey

     

    Program Manager, Web Platform & Tools

     

    http://www.asp.net/whidbey to download the slides

    http://weblogs.asp.net/rhoward

     

    ASP.NET 1.X Output Cache

    • Page Output Caching
      • Cache contents of page to memory
      • Reused cached page on subsequent requests
      • Supported HTTP 1.1 Cache semantics
    • Partial Page Caching
      • Cached User Control in a page
      • Allowed for portions of page to be cached
      • Time based dependencies
    • Programmatic Cache API
      • Cache objects in memory
      • Same cache used for Output Caching
    • Dependencies
      • Time, Key, File
      • Remove items when dependency changes
    • Removal event 

    ASP.NET 2.0 Cache

    • Most requested Cache features
      • Support database invalidation
      • Create your own dependencies
    • We listened…
      • Added SQL 7/2000/’Yukon’ cache invalidation 

    SqlCacheDependency

    System.Web.Caching

    • SQL 7 & 2000 Support
      • Table change dependencies on SQL 7 & 2000
      • Requires configuration settings
      • One-time setup of SQL Server database
      • Polling model
    • SQL Server “Yukon
      • Result Set dependencies for SQL Yukon
      • Supported through ADO.NET SqlCommand
      • No setup required
      • Notification model 

    SQL Yukon – push based model. Yukon will detect when changes occur and will push to ASP.NET … other databases use a polling method.

     

    SQL 7 & 2000 require a one-time setup … create a table in the database and some stored procedures. SQL Yukon – no setup required.

     

    SQL 7 & 2000

    • Table level notifications only
      • Notification when data in table changes
      • Row-level notification is not supported
    • Requires one time setup of SQL 7/2000
      • Triggers on tables that participate
      • Stored procedures called to check
    • Of Note:
      • Entries in cache table <# of tables in DB
      • Entries in cache = # items in cache table 

    New attribute in the output directive – sqldependency=”MyDatabase:Products”

     

    In the web.config:

      

      

     

    Cache.Insert(cacheKey, dataset, New SqlCacheDependency(“ACME”, “Products”))

     

    There is no Oracle cache dependency. We don’t know if we want to build one – all because of time constraints. You can build your own though. Easy to do.

     

    Behind the scenes: When we do this polling, we do not do this on your request thread, therefore there is no overhead on the polling.

     

    Dim d as New SqlCacheDependency()

     

    How does this all work? We use a tool aspnet_regsqlcache.exe – this is going to go away in the beta. Set up your database. Creates table. Trigger created. Created dataset and page and we begin monitoring. You update to a table is causing the trigger to change the SqlCD table and then your asp.net page knows to use the new data.

     

    Enabling SQL 7 & 2000

    • Alpha – Command Line only
      • Aspnet_regsqlcache.exe
    • Beta – Command Line and Wizard
      • Rolled into aspnet_regsql.exe 

    Enabling the table and the database are two separate and distinct things.

     

    configuration – only for sql server 7 and 2000

    • Relates friendly name to connection string
    • Control default polling settings 

    pollTime attribute causes the refresh of the polling. This is optional.

     

    • section
      • Identify connection string 

    SQL Server ‘Yukon

    • Granular Notification Support
      • Ex., when data in table changes
      • Ex., when SPROC results change
    • Built in feature of the database
      • No triggers or other services to install
      • Pushes changes to subscribers
    • ADO.NET SqlCommand
      • Supported by Yukon only

    This works in a web garden as well.

     

    CacheDependency Changes

    • No breaking changes to CacheDependency
      • Backwards compatible with v1.x code
    • ASP.NET 2.0 CacheDependency class:
      • New virtual properties/methods 

    New APIs

     

    ASP.NET 2.0

    • Post-Cache Substitution
      • Ouput cache entire page
      • Identify regions that are dynamic
    • Uses a PlaceHolder buffer
    • New Response.WriteSubstitution()
      • Wires up substitution event on page
      • Adds a substitution buffer to the response
      • Substitution event returns string value to add
    • New control
      • Drag and drop anywhere content should go.

  • Visual Studio.NET Road Map 2004-2005

    As usual, a the road is clean and green....:)

    The important milestones are...

  • Visual Studio code name "Whidbey" (2004). This release of Visual Studio and the .NET Framework will offer innovations and enhancements to the class libraries, common language runtime (CLR), programming languages, and the integrated development environment (IDE). In addition, this product will provide deep support for SQL Server code name "Yukon" by enabling developers to write stored procedures using managed code.
  • Visual Studio code name "Orcas" (2005). This version of Visual Studio and the .NET Framework will provide tools support for the Windows operating system, code name "Longhorn."
  • Joys of ASP.NET 2.0 - Series - Part 1 from PDC

    Thanks Eron for this post.

    Database-driven cache invalidation is thrilling.  Did you know that you can achieve table-level cache invalidation with ASP.NET today?  Here's how:

    The stock ASP.NET 1.0 CacheDependency class can monitor a local or network file.  As the file changes, the appropriate cache entries are evicted from the cache.  We can leverage this to achieve near-realtime cache invalidation as database data changes. 

    • Write a trigger for each table you want to monitor.  The trigger will touch a file on the database's filesystem.  The filename will correspond to the table name.  This can be achieved by invoking the FileSystemObject scripting object.
    CREATE PROCEDURE TouchFile(@FileName varchar(255)) AS
    DECLARE
    @FS int, @OLEResult int, @FileID
    int
    EXECUTE
    @OLEResult = sp_OACreate 'Scripting.FileSystemObject', @FS OUT
    IF @OLEResult <> 0 RAISERROR
    ('could not create FileSystemObject',16,1)
    -- touch the file
    execute
    @OLEResult = sp_OAMethod @FS, 'OpenTextFile', @FileID OUT, @FileName, 2, 1
    IF @OLEResult <> 0 RAISERROR
    ('could not touch the file',16,1)
    EXECUTE
    @OLEResult = sp_OADestroy @FileID
    EXECUTE
    @OLEResult = sp_OADestroy @FS
    • Share the relevant folder in the database's filesystem.
    • Setup CacheDependency instances to watch the appropriate files for changes.   Use methods on the Response object to interoperate with page-level output caching.  Use the raw caching API for arbitrary data caching.

    This technique offers a number of advantages over the proposed polling mechanism in Whidbey.

    • The invalidation will occur more quickly than with a polling mechanism.
    • No polling is used - the caching API uses the FileSystemMonitor component, that in turn leverages a callback mechanism to detect filesystem changes.

    Other notables about this approach:

    • Like the Whidbey mechanisms, it is web garden and web cluster friendly.
    • An extremely narrow race condition might exist.  It occurs when two or more triggers attempt to touch the same file.  One will succeed, others will fail.  Will this result in stale data?  Given the asynchronous nature of FileSystemMonitor, it is extremely unlikely.  Nonetheless, you might want to bat around the scenarios in your head. 

  • ASP.NET Whidbey Information

    ASP.NET "Whidbey"  is now published on asp.net's web with an overview of the product and screen shots.

    ASP.NET “Whidbey” Overview Whitepaper
    Get a quick overview about what ASP.NET “Whidbey” and Visual Studio “Whidbey” have to offer.  See the core concepts and key themes that went into building “Whidbey.”

    Visual Studio “Whidbey” Whitepaper
    See in-depth all the new productivity and development features that Visual Studio “Whidbey” has to offer.  This whitepaper provides a drill-down on all the new features with examples of how they make the Web development experience better. 

    PDC Presentations and Hands on Labs
    Here you will find all the great presentations, code, and hands on labs that were available to attendees at the PDC.  You will find deep technical information about all the new features, labs with screenshots that take you through the product, and code samples so you can begin learning how to take advantage of “Whidbey” today.

    Get involved with the “Whidbey” Forums
    The ASP.NET “Whidbey” forums are your place to find more information, provide feedback, and get your questions answered by members of the product team and the community!

  • DNUG Hyd meet at Greenpark

    Last weekend the managers of Dotnetusergroup - Hyderabad had a nice meeting at Hotel Green Park.
    Lot of community issues were discussed and took some resolutions to promote DNUG hyd to a good level.
    Ravikanth [MVP], Suresh [MVP] and Jaffer [Community Star] shared some valuable suggestions and concerns on community practices which could help Hyderabad’s .net community more.

    Some of those are

    01. To have manager meetings monthly.
    02. More seminars on architectural topics.
    03. Shorten the group's URL to get more reach.
    04. To get a nice premises for meetings.
    05. To start a library.
    06. Inclusion of community stars as group coordinators.
    07. To modify the home page to look more professional.


     

  • MessageBox Cutomization in winforms

    Dino's brain child is always cool :)

    Found this friendly customized MessageBox for managed code.
    The usage is very simple as its parent...

    msg.IconFile = "swf.ico";
    msg.YesAllNoCancel = false;
    DialogResult dr = msg.Show("Hello, managed world!", "Cutting Edge",MessageBoxButtons.OK);
    Console.WriteLine(dr.ToString());

    the coolest thing is, it can pick up an icon from standard Icon resource files like shell32.dll etc...

    with one small modification to the above code.

    msg.IconFile = "shell32.dll";
    msg.Index    = 12;

    Cool...is'nt it?

  • Worker blogs raise some company concerns

    from  USAT

    “There are an estimated 1.2 million blogs, or Web logs — Web pages that function as personal publishing forums. But few companies have blog policies, and they run a risk should their employee divulge confidential company information or make statements that compromise it financially or legally.“

  • MS Digest from Deepak

    Got this interesting digest from Deepak [MS]

    From Deepak (MS)

    During last few days I came across some interesting (and not so interesting) stuff which I thought I’d share with you… 


    a.)     VB vs. VB.NET: Here is a recent benchmark that we published: http://msdn.microsoft.com/vbasic/productinfo/benchmarks/. Bottom-line – “Visual Basic .NET Significantly outperforms Visual Basic 6.0”. Unfortunately it’s a nile benchmark and talks mostly about asp/asp.net – worse it ropes in Windows Server 2003/IIS6 which dilutes the VB vs. VB.NET scenario a little. Still worth a look. 


    b.)     We have had to make some changes to the way IE works with Active X controls. This might break some of your code. I highly recommend taking a quick look at http://msdn.microsoft.com/ieupdate/. Here is a short synopsis on what’s in it: 


    “This section describes changes to Internet Explorer's handling of ActiveX controls and Java applets. Developers who build ActiveX controls, Web developers who use ActiveX and Java Applets on their Web sites, and developers who host the Web Browser OC or MSHTML should consult this documentation to understand how the user experience is changing, and also how to modify their pages to manage the user experience for their content.” 


    c.)     After 100 VB.NET samples, its now turn of some neat C# samples. http://msdn.microsoft.com/vcsharp/downloads/samples/23samples/default.aspx. Some of them address interesting FAQs like “Read and Write Images to a SQL Server Database with C#”, “Implementing Drag and Drop in Windows Forms with C#” and “Creating a Masked Edit Control using .NET Framework Regular Expressions with C#”. Worth a look! 


    e.)     Some commentary on Viruses on Linux vs. Windows: “Linux vs. Windows viruses: a rebuttal”, http://www.virusbtn.com/news/latest_news/granneman


  • Concerns on MSVS

    Few concerns were born from my thoughts on Microsoft Virtual PC/Server after a demo session in MS.

    Scenario 1

    01. Windows XP is booted from a VHD located on my system
    02. My Anti Virus Software is scheduled for a scan at the same time and trying to hook that VHD for shared lock to scan it.
    03. If VHD is on exclusive lock by VPC, user could copy some virus infected files in to that virtual drive from network and affect that PC? Or not?

    Scenario 2


    01. I have installed a clean image of windows XP on a VHD and activated it.
    02. While generating hardware hash key, which hardware configuration will be used by XP? If it is using the physical host's HW configuration, does it need to be activated for each Machine per VHD?


     

  • SOEA Development...

    This nice article discussed about the guidelines and architecture of Service Oriented Enterprise Appication development in .NET..

    Take a glance at current challenges ...

    Current challenges

    In the past, the companies that have tried to offer solutions for enabling a Web site to expose application integration information and functionality in a modular, scalable, and Internet-friendly way have encountered significant challenges. Chief among these challenges are the following:

    • Time to market. The length of development time for getting an application or Web site to market may render the offering no longer viable.
    • Scaling to the Web. Existing object models and component designs simply do not work over Internet protocols. Stateless application development that can be rerouted and served by any server is a new concept for many developers. Yet such a design pattern is vitally important to achieve global scalability.
    • Lack of end-to-end development tools. Tool sets available today don't empower organizations with the flexibility necessary to stay ahead of their competitors. In the rapidly changing world of the Internet, organizations must exhibit the agility to integrate with new partners, using development tools that solve the challenges of today's heterogeneous computing environments.

  • Lessons from Mt. Everest

    Great 7 from stephen's post.

    My favourite one is :

    Just do it. Damn those Nike people are smart. There were a few scary things on this trek. The first time I saw the Khumbu glacier, it looked very intimidating. A friend told me, “Just do it.” Just have no fears and inhibitions and face your fears and challenges head on. Once again, life is just way too short.”