Archive

Archive for the ‘Visual Studio’ Category

Visual Studio Tip => Run to cursor

August 6, 2010 Rhonda Leave a comment

Learn something new everyday. The Run To Cursor debugging feature in Visual Studio allows you to set a temporary breakpoint. This serves as a helpful tool in debugging.

Just position the cursor, right-click and select Run To Cursor. The program will run up to the position of your cursor and pause to allow you to step through the code from there.

RunToCursor

This feature has been around since Visual Studio 2008 and maybe even earlier…

^..^

New Visual Studio Tips Series

January 22, 2010 Rhonda Leave a comment

A long time ago, I wrote a blog post on Sara Ford’s book Microsoft Visual Studio Tips as well as her very nice Tip of the Day series.

She has since ended her series and passed the "reins" to Zain Naboulsi who has done a wonderful job with a series of tips for Visual Studio 2010.

I highly recommend checking out Zain’s series…lots of great tips to be absorbed.

Additional Information

^..^

Categories: Visual Studio

HDNUG – January 2010 Meeting – Recap

January 18, 2010 Rhonda Leave a comment

I attended the January 2010 Houston .NET User Group meeting and there was a great turnout (about 100 people in attendance)  to see Rob Vettor speak on Visual Studio 2010.

Announcements

2010 Officers

  • President – John Hellman
  • Vice President – J Sawyer
  • Treasurer – Michael Steinberg
  • Secretary – Justin ???

2010 Houston Techfest – Saturday, 10/09/2010 @ University of Houston

Markus Egger will be the speaker at the February 2010 meeting

New and long awaited website design at http://www.hdnug.org

Zain Naboulsi announced the Windows 7 "Windows @ Work" Article Contest. A contest that he is putting on in conjunction with The Code Project.

Submit a great article explaining how you built an app for Windows 7 – complete with code – and if yours is the highest rated article by both The Code Project community and our judges, you could win a fully loaded HP Touchsmart tx2z Notebook!

Visual Studio 2010 is slated for release 4/22/2010

hdnug-jan1

The main presentation was given by Rob Vettor. He talked about Visual Studio 2010 and the history of how it came about as well as some of the new features.

Some New and Extended Features in VS 2010

  • CLR 4.0
  • Cloud Computing
  • Parallel Computing
  • Visual F#
  • VS UI is built in WPF
  • DLR – Dynamic Language Runtime
  • MEF – Managed Extensibility Framework (for building plugins for VS)
  • All the normal languages have been extended (C#, VB.NET, AJAX, etc)
  • Entity Framework 4.0
  • Multi-Targeting – Capability of dealing with previous versions of the Framework (2.0+)

Sku Versions

The number of Visual Studio versions has been reduced. Now there are only 4 main skus to remember :-)

Here is a comparison of the old sku setup to the new sku setup.

vsskus-comp

Below is what is included in each of the new skus.

vs2010skus

 

Roadmap

  • Beta 1 has come and gone
  • Beta 2 is now available
  • March 2010 – Release Candidate
  • April 22/2010 – Official Release

Rob gave a great high-level overview of what is  coming in Visual Studio 2010.  As always, there were some good magazines given away. :-)

hdnug-jan2

Until next month…

^..^

Visual Studio Issue with Data Sources

November 11, 2008 Rhonda Leave a comment

I have had this issue twice in the past few months, so I am posting this so I won’t have to hunt for it again.

The issue is when I go to open or add a table adapter in Visual Studio. For some reason I receive the following error.

“Key not valid for use in specified state.”

I found a thread in the General Discussions category of the Microsoft Newsgroups that seems to resolve my issue.

Adding Data Source Error: Key Not Valid For Use In Specified State

I opened my Data Connections list and deleted what was there, went back to my project and magically, no error when I tried to add/access a table adapter.

Categories: Visual Studio

Book Review: Microsoft Visual Studio Tips (Awesome Book)

October 28, 2008 Rhonda 1 comment

Microsoft Visual Studio Tips: 251 Ways to Improve Your Productivity
Author: Sara Ford
Publisher: Microsoft Press
No. Pages: 229

 

I pre-ordered the this book back in August and I have to say this is the best book on the Visual Studio IDE that I have ever run across.  It is a great collection of tips taken from Sara Ford’s ever-popular Visual Studio Tip of the Day.  I really like the “Sara Aside” sections where extra insight is given about the tip.

There are tips for (but not limited to) the following -

  • Dealing with the editor
  • Searching files
  • Development environment
  • Debugging
  • Design time tools

If you have to spend any amount of time in Visual Studio then this book is definitely worth the money as I will be referring back to it time and time again. I am also recommending it at my office.  Especially for beginners to .NET.

Happy Reading.

Visual Studio Themes

March 28, 2008 Rhonda 2 comments

Every now and again, I get tired of looking at the same white background for coding in Visual Studio.  I have started seeing several blog posts that deal with changing the color scheme of the editor in Visual Studio.  Out of all the color schemes that I have found, I like the one from John Lam the best.

Below is the way to apply an outside color scheme:

First, find a color scheme that you like, download the .vssettings file and place it in the ..\Visual Studio 2008\Settings folder.

In Visual Studio, go to the Tools Menu and select Import and Export Setting…

VSThemes-1

Following the wizard – Select Import selected environment settings

VSThemes-2

Following the wizard – Select Yes, save my current settings.  Choose to back up your current settings.  This will help if you decide to go back to the original theme or something goes wrong with the one you are trying to apply.

VSThemes-3

Following the wizard – Find the *.vssettings file you want to import and select it.

VSThemes-4

Following the wizard – Select the settings to import – in this case I just selected all.

VSThemes-5

New editor theme

VSThemes-6 

Pretty sweet to be able to go back and forth with themes – sometimes it just depends on my mood.  This works with both Visual Studio 2005 and 2008.

Related Content
Scott Hanselman — Changing your colors in Visual Studio.NET – Black versus White
Scott Hanselman — Visual Studio Programmer Themes Gallery
Roy Osherove — Dark Colored Visual Studio Color Scheme

Categories: Visual Studio

VS 2008 and WPF

February 24, 2008 Rhonda 3 comments

I finally got around to installing Visual Studio 2008 this weekend. The first thing I thought I would try to learn something about is Windows Presentation Foundation (WPF). WPF is a graphical subsystem feature of the .NET 3.0 framework that provides a clear separation between UI and Business logic. The mark up language used in WPF is called Extensible Application Markup Language (XAML). XAML looks like any other markup language like HTML and XML.

Below is a sample form built in WPF.

Create new project

FirstWPF-Create

Solution Explorer

FirstWPF-SolutionExplorer

XAML Designer

FirstWPF-XamlDesigner

Form in Runtime

FirstWPF-FormInRuntime

XAML Listing

<Window x:Class="FirstWpf.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Calculate Max Heart Rate" Height="181" Width="370" Background="LemonChiffon">
    <Grid Height="141" Width="339">
        <Button Margin="89,0,92,13" Name="button1" Click="button1_Click"
             Height="23"
             VerticalAlignment="Bottom"
             FontWeight="Bold"
             Foreground="DarkGreen">Click Me</Button>
        <TextBox Height="23" Margin="0,21,115,0" Name="textAge"
             VerticalAlignment="Top"
             HorizontalAlignment="Right" Width="36" />
        <Label Height="23" Margin="83,21,0,0" Name="label1"
             VerticalAlignment="Top" HorizontalAlignment="Left"
             Width="65" FontWeight="Bold"
             Foreground="DarkBlue">Enter Age</Label>
        <Label Margin="38,56,35,44" Name="labelHR" FontSize="9"
             ForceCursor="False" HorizontalContentAlignment="Center"></Label>
    </Grid>
</Window>

C# Code Behind

using System;
using System.Windows;

namespace FirstWpf
{
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
          try
          {
            int age = Int32.MinValue;
            int maxHr = 0;
            age = Int32.Parse(textAge.Text);
            maxHr = 220 - age;   labelHR.Content = "At the age of " + age.ToString() + " the Max HR should not rise above " + maxHr.ToString();
          }
          catch (Exception)
          {
            labelHR.Content = "Input is not valid";
            return;
          }
        }
    }
}

WPF/XAML is a feature rich and powerful programming model. In upcoming posts, I will go into deeper detail on some of the great features.

There are a plethora of internet resources for this interesting new technology. Below are just a few of them.

Related Content
Windows Client.NET – Official MS Site
Josh Smith on WPF
Karl on WPF
WPF Wonderland
The WPF Blog
Learn WPF
Your XAML Information Page

Happy programming!!!

Categories: Visual Studio, WPF

Useful Visual Studio Search Tool

January 5, 2008 Rhonda Leave a comment

I was jumping around in our main solution yesterday making little bug fixes and needless to say it was becoming a bit tedious trying to find where I needed to go in the code. My co-worker then told me about the Find in Files search option. It is a tool that will search solution-wide or project-wide for a word and give you a listing of the results. When you find the occurrence in the result list, double-click it and VS will take you to the exact place in the code.

Menu navigation: Edit > Find and Replace > Find in Files, Keyboard shortcut Ctrl + Shift + F

search1.gif

search2.gif

search3.gif

search4.gif

Pretty sweet! This is really useful if there are a lot of changes to be made. There are still many little tidbits to learn about the VS environment, which is why I really like Sara Ford’s VS 2008 Tip of the Day posts as well as the .NET Tip of the Day.

Categories: Visual Studio

Visual Studio DataSet Visualizer

December 9, 2007 Rhonda Leave a comment

I am still rather new to .NET, so there are many little tips and tricks that I still do not know. I was needing to easily see exactly what was populating a data set and someone at work showed me how to access the DataSet Visualizer.

To demonstrate this, the code below creates and populates a small data set.

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace CrtDataSet
{
  class Program
  {
     static void Main(string[] args)
     {
        DataSet StateDS = new DataSet();
        DataTable statesTable = StateDS.Tables.Add();

        statesTable.Columns.Add("ID", typeof(int));
        statesTable.Columns.Add("StateCode", typeof(string));
        statesTable.Columns.Add("Description", typeof(string));
        statesTable.Columns.Add("Capital", typeof(string));

        statesTable.Rows.Add(1, "TX", "Texas", "Austin");
        statesTable.Rows.Add(2, "AR", "Arkansas", "Little Rock");
        statesTable.Rows.Add(3, "AZ", "Arizona", "Phoenix");
        statesTable.Rows.Add(4, "FL", "Florida", "Tallahassee");
        statesTable.Rows.Add(5, "LA", "Lousiana", "Baton Rouge");

        foreach (DataTable table in StateDS.Tables)
          {
             foreach (DataRow row in table.Rows)
             {
                Console.WriteLine(row["StateCode"] + " ~ " + row["Description"] + " ~ " + row["Capital"]);
             }
          }
     }
  }
}

To look at the contents of the data set via the DataSet Visualizer, set a breakpoint and run the program in debug mode. After the data set is populated, hover the mouse pointer over the data set name and click on the magnifying glass.

CLICK PICTURE FOR LARGER IMAGE

After clicking the magnifying glass icon, a grid appears showing the contents of the data set.

Great Sources for Visual Studio and .NET Tips

Categories: Visual Studio

Visual Studio 2005 SP1 is Available

December 17, 2006 Rhonda Leave a comment

Visual Studio 2005 Service Pack 1 is available. It can be downloaded here; however, I would suggest reading Scott Guthrie’s blog entry first as it has a plethora of information about this major update and his suggestions on how to install it.

Sounds like you will need to plan when to perform the update because it will likely take at least an hour.

-

[- Related Links -]
Visual Studio 2005 SP1 link roundup
..(Via – The Daily Grind by Mike Gunderloy)

Categories: Visual Studio