in

vbCity Blogs

New (temp) place for vbCity Blogs

Mike McIntyre's .NET Journal

March 2009 - Posts

  • Can't Update Sql Server Express Database in Visual Studio Solution?

    Your problem is likely the result of the Copy to output directory property on the database.

    The Copy to output directory property controls when your database is copied when debugging your application.

    By default, the database is copied to the output directory every time you debug (F5) your application.  This means you will never see the results of the last debug session because inserts, updates, and deletes are made to the copy in the output directory and the next time you debug, the project database is copied to the output directory, replacing the copy with your edits.

    For debugging, change the Copy to output directory property to Copy if Newer

    The Copy To Output Directory option can be found on the property window when the database is selected in Solution Explorer.

    Mike McIntyre [MVP Visual Basic]
    Source Code for .Net Programmers
    www.getdotnetcode.com
    Blog - Mike McIntyre's .Net Journal

     

  • Edit Mode Strategy using a Windows Forms GroupBox Control - C# and VB Example

    C# and VB Source Code: Edit Mode Strategy using a Windows Forms GroupBox Control

    Edit Mode Strategy using a Windows Forms GroupBox Control

    An edit mode strategy is a strategy for enabling and disabling data editing controls on an application form.

    The Windows Form GroupBox control is a container control; it can be used to logically group a collection of controls on a form.

    This solution demonstrates how to use a GroupBox to switch between editing allowed and editing not allowed.

  • Silverlight Toolkit Example Code - Visual Basic Examples

    In the latest releases of the Silverlight Toolkit are available and include VB source code.

    The Silverlight Toolkit March 2009 release is enhanced with Visual Basic source code for both Silverlight 2 and Silverlight 3. The Toolkit is a collection of controls, components and utilities made available outside the normal Silverlight release cycle. It includes full source code, unit tests, samples and documentation for 18 new controls covering charting, styling, layout, and user input, in addition to 11 professional themes. The team wants feedback so join the forums and submit suggestions today.

  • Composite Application Block for WPF and Silverlight - Visual Basic Examples

    The Microsoft Patterns and Practices Developer Center has released the Composite Application Block for WFP and Silverlight.

    The Composite Client Application Guidance is designed to help you more easily build modularWindows Presentation Foundation (WPF) and Silverlight client applications.

    These types of applications typically feature multiple screens, rich, flexible user interaction and data visualization, and role-determined behavior. They are "built to last" and "built for change." This means that the application's expected lifetime is measured in years and that it will change in response to new, unforeseen requirements. This application may start small and over time evolve into a composite client—composite applications use loosely coupled, independently evolvable pieces that work together in the overall application. Applications that do not demand these features and characteristics may not benefit from the Composite Application Guidance.

    Read more about it at:  Composite Application Block

    Download the VB Examples here.

  • Conditional If Operator Visual Basic 2008 - Short Circuit Logic

    The Visual Basic 2008 conditional If operator tests an expression and returns a value using short-circuit evaluation to conditionally return one of two values.

    Unlike the IIF runtime function the conditional If operator only evaluates its operands if necessary.

    In the code below , If(divisor <> 0, number \ divisor, 0) ,will not throw an exception if the value of number is 0.

            Dim number As Integer = 10

            Dim divisor As Integer = 0

            ' Because divisor = 0, 'number \ divisor' will not be evaluated

            '  thus(avoiding) a division by 0 exception.

            MessageBox.Show(If(divisor <> 0, number \ divisor, 0).ToString)

    mike mcintyre www.getdotnetcode.com

     

  • A Collection of Useful Links for Internet Explorer 8 (IE 8)

    Internet Explorer 8

    Windows Internet Explorer 8: Home page

    Download Internet Explorer 8 RC1, the latest version of Microsoft's new, improved, and free web browser.

    Wikipedia, the free encyclopedia

    Windows Internet Explorer 8 (abbreviated IE8) is the next version of Internet Explorer, succeeding Internet Explorer 7. Beta 1, targeted at web designers and developers, was ...

    New Features To Slice, Store, And Accelerate Your ...

    This article is based on a prerelease version of Internet Explorer 8. All information is subject to change.

    Internet Explorer 8 Promises Better Standards Compliance...and a Whole ...

    Developer release lauded as "sweet!" but puts the focus on security, interoperability and better programming features rather than the user experience.

    What's New in Internet Explorer 8

    This topic introduces the platform features of Windows Internet Explorer 8.

    Add-ons Gallery

     

  • LINQ to Micorosoft Access via LINQ to DataSet

                // Fill the Customer table that is part of the AjaxDataSet
                AjaxDataSetTableAdapters.CustomerTableAdapter customerTableAdapter = new LINQ_To_MSAccess_CS2008.AjaxDataSetTableAdapters.CustomerTableAdapter();
                customerTableAdapter.Fill(ajaxDataSet.Customer);
                // Use Linq to DataSet to query the Customer table.
                var customerQuery = from c in ajaxDataSet.Customer.AsEnumerable() select c;
                foreach (AjaxDataSet.CustomerRow customer in customerQuery)
                {
                    MessageBox.Show(customer.Name);
                }

    Learn More

    LINQ to DataSet

    LINQ to DataSet makes it easier and faster to query over data cached in a T:System.Data.DataSet object. Specifically, LINQ to DataSet&#160;simplifies querying by enabling ...

    ADO.NET team blog : Querying DataSets – Introduction to LINQ to ...

    Greetings fellow data junkies! My name is Erick Thompson, a PM at Microsoft who is working on driving ADO.NET forward to utilize the latest and best technology that we have coming ...

    The Moth: LINQ to DataSet

    Another LINQ implementation that will ship with Fx 3.5 is LINQ to DataSet (not to be confused with LINQ to SQL). LINQ to DataSet is about offering a strongly typed in-memory query ...

    LINQ To DataSet Samples

    LINQ to DataSet Samples

    LINQ to DataSet | DanielMoth | Channel 9

    Author: Hi, I am Daniel Moth Introduction: Assuming you understand how LINQ to objects works and assuming you know how DataSets work, this 18' video shows you how LINQ to DataSet ...

    LINQ to DataSet

    Latest screencasts by Daniel Moth. Managed AddIn Framework (Part 2) Managed AddIn Framework (Part 1) Sync Services for ADO.NET. Debugging Into the .NET Framework Source Code with ...

    LINQ to Datasets - Hooked on LINQ

    Edit Introduction LINQ to DataSet allows developers to write “queries” over existing DataSet sources within applications. DataSet’s were the main tool prior to LINQ that ...

    Introducing LINQ to DataSet : The Official Microsoft ASP.NET Site

    Microsoft portal site for the ASP.NET development community. Download Visual Web Developer, post to the forums, read ASP.net blogs and learn about ASP.net.

    CoDe Magazine - Article: Rich Query for DataSet- An Introduction to ...

    ... .NET framework 3.5, Microsoft® will introduce support for a technology called Language Integrated Query (LINQ), and with this introduction, an implementation of LINQ to DataSet.

    CoDe Magazine - Article: Rich Query for DataSet- An Introduction to ...

    Rich Query for DataSet- An Introduction to LINQ to DataSet (Cont.) Shaping the Query Results-Beyond DataRows. LINQ query developers often want to shape their query results to meet ...

    MSDN Webcast: Introducing LINQ to DataSet (Level 200)

    Join this session as we explore how new technologies within Microsoft Visual Studio code name "Orcas" make working with data a better experience.

     

     

  • Usage Statistics for Developers - StatOwl

    While researching commonly used screen resolutions for a development project, a fellow Microsoft MVP sent me the link to StatOwl. Thanks Antonio!

    This site is becomming a good place for developers to go when they have questions about what audiences, software, hardware, and more to target. The information offered on this site provides insight into Internet usage trends including browsers, operating systems, system settings, and much more. 

     StatOwl

  • Loading Double-Clicked Documents into a Single Instance VB.Net Application

    How can documents configured to open with a VB.NET Win Forms application (VB.NET 2005 and newer) - when double-clicked - be opened by a single instance of the application?

    The instructions below explain how to make an application a single instance application and how to open documents with a file extension of .az in a single instance of the application.

    The instructions assume that the .az file extension has already been associated with the application:

    1.  Make a Windows Forms VB.NET 2005 or newer application a single instance application via the applications properties interface; see the 'Make single instance application' checkbox in the image below:

    Single Instance VB.NET Win Forms App

    2. Next, add a new class file to the application project that extends the VB.NET MyApplication class:

    ' Extending the MyApplication class to load files

    '   with a file extension of .az

    Namespace My

        Partial Friend Class MyApplication

     

            ' Override the OnStartup function in case a file with the .az extension

            '  is double-clicked before this single instance application is already running.

            Protected Overrides Function OnStartup(ByVal eventArgs As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) As Boolean

                If eventArgs.CommandLine.Count > 0 Then

                    LoadTextDocument(eventArgs.CommandLine(0))

                End If

                Return MyBase.OnStartup(eventArgs)

            End Function

     

            ' Override the OnStartupNextInstance sub in case a file with the .az extension is

            '  double-clicked after this single instance application is already running.

            Protected Overrides Sub OnStartupNextInstance(ByVal eventArgs As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs)

                If eventArgs.CommandLine.Count > 0 Then

                    LoadTextDocument(eventArgs.CommandLine(0))

                End If

                MyBase.OnStartupNextInstance(eventArgs)

            End Sub

     

            ' Add a sub for loading files that takes a file path argument.

            Protected Sub LoadTextDocument(ByVal filePath As String)

                Dim theFile As New System.IO.FileInfo(filePath)

                ' Currently this sub only handles file extensions of .az

                '  Add cases for other application file extensions as needed.

                Select Case theFile.Extension

                    Case ".az"

                        Dim fileContents As String = My.Computer.FileSystem.ReadAllText(filePath)

                        My.Forms.SampleForm.ResultsRichTextBox.AppendText(fileContents)

                End Select

            End Sub

     

        End Class

    End Namespace

  • Free Process Identification Tool - Uniblue Process ProcessQuickLink

    This free tool from Microsoft Gold Certified 'UniBlue' makes it dirt simple to get information about processes running on your computer.

    After installation a green icon is shown to the left of each process in Task Manager.

    Click an icon to access UniBlue's process page.

    Get this tool -> http://www.processlibrary.com/quicklink/

    Uniblue ProcessScanner

    mike mcintyre   GetDotNetCode 

Copyright 1998-2009 vbCity.com LLC
Powered by Community Server (Non-Commercial Edition), by Telligent Systems