Welcome to MSDN Blogs Sign in | Join | Help

Bing Maps Silverlight Control final and ready to download

I’m happy to report that the Bing Maps team shipped the final Bing Maps Silverlight Control with their Wave 14 update. Finally, no more screwing around with JavaScript but developing in in nice, good ol’ VB.NET or C# :-)

Btw, we updated Bing Maps as well by using the above mentioned SL control. This is especially sweet as the responsiveness got fantastic and we (finally) introduced Multi-point drag-drop directions :-)

Enjoy the goodness (which is usually VB but today Bing Maps) :-)

   Daniel

General availability of Visual Studio 2010 and .NET Framework 4 Beta 2

As mentioned in my last post today’s the day that Visual Studio 2010 and .NET Framework 4 Beta 2 are generally available to the public. We’ve updated the Visual Studio 2010 and .NET Framework 4 Beta 2 landing page which now includes links to the various Visual Studio 2010 versions as well as to the .NET Framework.

Visual Studio

Visual Studio Extensibility

.NET Framework

Team Foundation Server

Test Products

Express

Get the bits while they are still warm :-)

   Daniel

Visual Studio 2010 and .NET Framework 4 Beta 2 are available and complemented by a complete msdn redesign

This morning we released Visual Studio 2010 Beta 2 together with .NET Framework 4 Beta 2.

Visual Studio 2010 and .NET Framework 4 Beta 2

These releases were accompanied by a major redesign of both the msdn Library as well as the msdn Developer Centers.

Microsoft Developer Network

Visual Studio Beta 2 will be released in English, Japanese, and German and the .NET Framework Beta 2 will be released in English, Japanese, German and Arabic.

In addition to shipping the new (81% smaller) Client Profile of the .NET Framework, Beta 2 is the first version of Visual Studio to ship the new simplified SKU line up:

  • Microsoft Visual Studio 2010 Ultimate with MSDN: the comprehensive suite of application lifecycle management tools for software teams to ensure quality results from design to deployment.
  • Microsoft Visual Studio 2010 Premium with MSDN: a complete toolset for developers to deliver scalable, high quality applications.
  • Microsoft Visual Studio 2010 Professional with MSDN: the essential tool for professional development tasks to assist developers in implementing their ideas easily.

Visual Studio 2010 and .NET Framework Beta 2 is available to MSDN subscribers on Monday, October 19th, with general availability on October 21st.

Get all the details on the Beta 2 landing page or Somasegar’s blog (Announcing Visual Studio 2010 and .NET FX 4 Beta 2, Come meet the new MSDN).

Enjoy!

   Daniel

Free SQL Server 2008 Express How-To-Guide Series

Thanks to the SQL Server Team we just released a free SQL Server 2008 Express How-To-Guide Series on msdev.com. During the next weeks we’ll also integrating parts of the series into the Visual Basic Developer Center, C# Developer Center, the Beginner Developer Learning Center, etc.

One video of the series: How do I query data in a database?

Given the fact that we don’t have unlimited resources (yeah, I know… that was the biggest surprise for me as well when I started working at Microsoft. “Where are all the bags with money standing around in each corner? What? There are none? D’oh!”) we tried to cover a pretty comprehensive area starting with basics like “How do I create a database?” over “How do I query data in a database?” to more advanced features like “How do I import data from another source (Excel, Access, XML, MySQL, ...) into a SQL Server Database?”.

Please let me know how you like the selection we made and if there are other topics you’d like to see*.

Enjoy!

   Daniel

P.S.: We’ll rearrange the videos soon to have a nice walkthrough including “Topics you should know before watching this video” and “Next videos you might want to watch”.

* I don’t want to raise wrong expectations in that I’m promising other videos to show up on request but depending on the topic/amount of people requesting content we might extend the series.

Posted by Walzenbach | 0 Comments
Filed under: ,

How do I edit tabular data/data in a DataGridView in a details form?

Abstract
This sample shows how to edit data from a DataGridView in a details form which opens when one double clicks on the RowHeader of the DataGridView. Since both forms are bound to the same datasource one sees an instant update on both forms when the user decides to save the data and additional roundtrips to the database are avoided. It also provides a brief introduction to DataBinding in .NET.
EditDetailsForm.png

Source Code
Visual Basic | C#

Additional Resources
Connecting to Data in Visual Studio
Getting Started with Data Access
Windows Forms Data Binding
Forms over Data Video Series

Prerequisites
The examples were created using Visual Basic 2008 Express (free download)/Visual C# 2008 Express (free download) but do also apply to earlier versions of Visual Studio (with minor modifications).

Enjoy!


   Daniel

How do I access the clipboard to copy and paste text, images or generic objects?

Abstract 
This short sample details how to access the clipboard to copy and paste text, images or generic objects. In order to do so this sample uses the Clipboard Class.
clipboard.png

How Do I Video
The corresponding How-Do-I video can be found here.

Source Code
Visual Basic | C#

Additional Resources
.NET Framework Class Library – The Clipboard Class

Prerequisites
The examples were created using Visual Basic 2008 Express/Visual C# 2008 Express but do also apply to earlier versions of Visual Studio.

Enjoy!

   Daniel

How do I inform one form that data in another form got changed?

Abstract
This short sample demonstrates how to let one form in a Windows Forms application know when data in another form got changed. To implement this behavior I’ll show you how to create an event on Form2 and how to subscribe to this event on Form1 using the Handles keyword. The C# source code uses delegates to implement the aforementioned behavior.
NotifyAnotherForm.png

How Do I Video
The corresponding How-Do-I video can be found here.

Source Code
Visual Basic | C#

Additional Resources
Handling and Raising Events
Events in Visual Basic

Prerequisites
The examples were created using Visual Basic 2008 Express but do also apply to older versions of Visual Studio. Even though this concept is demonstrated in Windows Forms the same pattern can be used in WPF.

Enjoy!

   Daniel

How do I exchange data between two forms of a Windows Forms application?

I regularly check the forums to get an understanding what’s going on in the community and what’s troubling our customers. Based on my findings I created some videos including the corresponding source code which I’m releasing over the next couple of days and subsequently when things come up (and there is a lot out there :-))

Abstract
This short video shows how to exchange data between two forms of a Windows Forms application. You'll see how to use
1.) a public method and
2.) a public property to exchange data.

How do I exchange data between two forms of a Windows Forms application?

How Do I Video
The corresponding How-Do-I video can be found here.

Source Code
Visual Basic | C#

Additional Resources
Access Modifiers in Visual Basic
Access Modifiers in C#
Property Usage Guidelines

Prerequisites
The examples were created using Visual Basic 2008 Express/Visual C# 2008 Express but do also apply to earlier versions of Visual Studio. Even though this concept is demonstrated in Windows Forms the same pattern can be used in WPF.

Enjoy!

   Daniel

Deutsche Alternative zu Stack Overflow

Mit codekicker gibt es seit kurzem eine deutsche Alternative zu Stack Overflow. Noch nicht ganz so groß wie das englischsprachige Vorbild aber das kann ja noch kommen :-)

 

Viel Erfolg an das codekicker Team und schöne Grüße!

   Daniel

Digg This
Posted by Walzenbach | 1 Comments
Filed under:

30 free Cheat Sheets (Browser compat, SEO, PHP, CSS, JS, SL, …)

Found a great list of 30 cheat sheets/Reference guides on webdesigner depot (Thanks to Günter Hagedorn for this tip!).

  1. 25-Point Website Usability Checklist
  2. Browser Compatibility Table
  3. Web Standards Checklist
  4. Search Engine Optimization Cheat Sheet
  5. Tweet Sheet 2
  6. XHTML Cheat Sheet v1.03
  7. CSS Cheat Sheet
  8. Blueprint Framework and Blueprint CSS Cheat Sheet
  9. Mixing Typefaces
  10. Common Fonts for all Versions of Windows, and Mac Equivalents
  11. Official Adobe Photoshop CS4 Reference
  12. Adobe Photoshop CS4 Keyboard Shortcuts
  13. Adobe Flash CS4 Keyboard Shortcuts
  14. ActionScript 2.0 to 3.0 Migration Cheat Sheet
  15. Adobe Dreamweaver CS4 Keyboard Shortcuts
  16. WordPress Help Sheet
  17. Advanced WordPress Help Sheet
  18. WordPress Theme Development Checklist
  19. JavaScript Cheat Sheet
  20. Regular Expressions Cheat Sheet (v2)
  21. jQuery Visual Map
  22. MooTools Cheat Sheet
  23. Prototype 1.6.0.2 Cheat Sheet
  24. Python
  25. mod_rewrite Cheat Sheet (v2)
  26. PHP Cheat Sheet (V2)
  27. SQL Server Cheat Sheet
  28. MySQL Cheat Sheet
  29. Ruby on Rails Cheat Sheet
  30. ASP/VBScript Cheat Sheet

This list neatly complements the Various Cheat Sheets (.NET, SQL Server, ASP.NET Ajax, CSS, JavaScript, RegEx, ...) post I did a couple of month ago which I updated with the following links:

Enjoy!

   Daniel

Digg This

EOS 5D Mark II Firmware Update Version 1.1.0 available for download :-)

Finally, find the update mentioned in the title on http://web.canon.jp/imaging/eosd/firm-e/eos5dmk2/firmware.html

Firmware Version 1.1.0 incorporates the following improvements and fixes.

  1. Includes a function to enable the manual exposure setting when shooting movies.*For details on how to use this function, please download the PDF files from the bottom of this page.
  2. Disables the function of the depth-of-field preview button when images are played back or when the menu screen is displayed on the LCD panel.
  3. Fixes a phenomenon where the peripheral illumination of images cannot be properly corrected, even if the images were captured with the lens peripheral illumination correction function set to Enable.*Digital Photo Professional software version 3.6.1 or later (for Windows and Macintosh) can be used to automatically correct the peripheral illumination of RAW and JPEG images that were captured in the Peripheral illumination correction setting with cameras that have Firmware Version 1.0.7 or earlier.
  4. Fixes the algorithms of the Auto Lighting Optimizer function when Custom Function C.Fn II-3 Highlight tone priority is enabled.
  5. Fixes incorrect indications on the Arabic, Romanian, Spanish, and Ukrainian menu screens.
  6. Changes the battery information displayed on the camera when using the optional Battery Grip BG-E6.

Source (http://web.canon.jp/imaging/eosd/firm-e/eos5dmk2/firmware.html)

if you’re looking for firmware updates for other canon cameras you might want to look here: http://web.canon.jp/imaging/eosd-e.html

 

Enjoy!

   Daniel

Posted by Walzenbach | 1 Comments
Filed under:

How to manage your parent’s/friend’s computer (The destiny of every computer geek)?

Ever since I remember I was in charge of my father’s computer (Well, to be honest, there was a time when I tried to install Skool Daze – a Commodore 64 game – on his brand new XT where he was ahead in the game but this quickly changed ;-) ).

Taking care of my father’s computer was an easy talk while we lived together in the same house but got significantly more challenging when I moved out, especially now that I’m in the US and my parents are in Germany. Since “remote controlling” my father on the phone wasn’t as easy as I hoped it to be (without going into details, I guess you know what I’m talking about…) I tried a couple of different programs including “Remote Assistance”, vnc, msn messenger and others over the time which all had different constraints. Without complaining to much none of them truly satisfied me. Fortunately though a friend introduced me to TeamViewer while we were struggling to setup his development environment and I’m using it ever since. Like Paint.NET, .NET Reflector, Fiddler, Process Explorer, FileZilla, … this is a “must have” tool for everybody doing IT-related work and getting regular requests from family and friends about “why the printer isn’t working anymore” or similar issues (I should probably write a “Must have tools” post).

To me it came down to a couple of things I liked about TeamViewer:

  • Didn’t have to worry worry about firewalls, IP addresses, NAT. It just worked
  • Free for private use
  • Can be run without being installed
  • Can be installed to run as a service on your parent’s computer which allows you to connect to this computer as long as it’s online

If you’re intrigued and have the same need (otherwise, what are you doing here ;-) ) give it a try and share your thoughts.

Happy administration!

   Daniel

Posted by Walzenbach | 1 Comments

When using LINQ to XML why don’t I get results if I don’t import a XML namespace?

Hi,

I posted a bit of code the other day which I used to get a list of all Code Snippets we ship in Visual Studio. In a nutshell, I used XElement.Load to create a new XML document from a filename from which I then read elements from (There are way to many ”from” in this sentence ;-) ). Unfortunately, I forgot to import the XML Namespace in the code I posted which caused my code not to return any results (but instead provided me with a brilliant opportunity to write another post. hehe :-) ).

Let’s have a look at the code which is causing trouble and a Code Snippets to understand what’s going on (you can find the complete code including the Snippet class in the aforementioned post):

Dim query = _

    From file In My.Computer.FileSystem.GetFiles( _

        "C:\Program Files\Microsoft Visual Studio 10.0", _

        FileIO.SearchOption.SearchAllSubDirectories) _

    Where file.EndsWith(".snippet") _

    Order By file

 

Dim snippets As New List(Of Snippet)

Dim snippetDocument As XElement

Dim snippet As Snippet

 

For Each item In query

    snippetDocument = XElement.Load(item)

    If snippetDocument...<Title>.Value IsNot Nothing Then

 

        snippet = New Snippet With {.Title = snippetDocument...<Title>.Value.ToString _

                                    , .Description = snippetDocument...<Description>.Value.ToString _

                                    , .Path = item _

                                    , .Size = New System.IO.FileInfo(item).Length}

        snippets.Add(snippet)

    End If

Next

  Code Snippet

<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

  <CodeSnippet Format="1.0.0">

    <Header>

      <Title>Activate a Running Application by Name</Title>

      <Author>Microsoft Corporation</Author>

      <Description>Activates a running application using the name of the application.</Description>

      <Shortcut>appActNa</Shortcut>

    </Header>

    <Snippet>

      <Imports>

        <Import>

          <Namespace>Microsoft.VisualBasic</Namespace>

        </Import>

      </Imports>

      <Declarations>

        <Literal>

          <ID>applicationName</ID>

          <Type>String</Type>

          <ToolTip>Replace with the name of the application. This is often the title of the application window.</ToolTip>

          <Default>"Untitled - Notepad"</Default>

        </Literal>

      </Declarations>

      <Code Language="VB" Kind="method body"><![CDATA[AppActivate($applicationName$)]]></Code>

    </Snippet>

  </CodeSnippet>

</CodeSnippets>

As you can see there is a <Title> element in the the Code Snippet to which we are referring to in the code above… or are we?

Let’s dig a bit deeper, open the compiled program in .NET Reflector and disassemble it (if you don’t have .NET Reflector you have to stop reading NOW and get it!! Seriously, this tool is a life-safer and I’ve learned soooo much using it!).

If you focus on the parts I highlighted in red in the above picture you can see that <Title> consists out of the XML name and the XML namespace (check out XName..::.Get Method (String, String)). Since I didn’t import the namespace in my program an empty namespace got used resulting in the qualified name Title which doesn’t fit the namespace of the Code Snippet {http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet}Title, hence my program didn’t return any results.

To solve this problem I added the following line of code to my program

Imports <xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

and – finally – all is good :-)

Hopefully this solved the mystery of the missing results ;-)

Best!

    Daniel

How to get a list of all files of a directory (subdirectories included)?

I needed to create a list of all Code Snippets we ship in Visual Studio the other day containing their title, description and path on disc and size. As you might know, Code Snippets are stored in multiple directories below "%ProgramFiles%\Microsoft Visual Studio 10.0" so I had to traverse all the subdirectories of the aforementioned path to find all snippets.

Fortunately – linq to the rescue – this came down to a few lines of code :-)

Dim query = From file In My.Computer.FileSystem.GetFiles("C:\Program Files\Microsoft Visual Studio 10.0", FileIO.SearchOption.SearchAllSubDirectories) _

            Where file.EndsWith(".snippet") _

            Order By file

This statement gives you a List of Strings (or, to be a bit more precise, a System.Linq.IOrderedEnumerable(Of String)) which you can walk over to do all kinds of crazy things.

Here is what I did to solve the problem I described above:

Imports <xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> 

 

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim query = From file In My.Computer.FileSystem.GetFiles(txtPath.Text, FileIO.SearchOption.SearchAllSubDirectories) _

                    Where file.EndsWith(".snippet") _

                    Order By file

        Dim snippets As New List(Of Snippet)

        Dim snippetDocument As XElement

        Dim snippet As Snippet

        For Each item In query

            snippetDocument = XElement.Load(item)

            If snippetDocument...<Title>.Value IsNot Nothing Then

                snippet = New Snippet With {.Title = snippetDocument...<Title>.Value.ToString _

                                            , .Description = snippetDocument...<Description>.Value.ToString _

                                            , .Path = item _

                                            , .Size = New System.IO.FileInfo(item).Length}

                snippets.Add(snippet)

            End If

        Next

        DataGridViewSnippets.AutoGenerateColumns = True

        DataGridViewSnippets.DataSource = snippets

    End Sub

End Class

 

Public Class Snippet

    Private _Title As String

    Private _Description As String

    Private _Path As String

    Private _Size As Long

    Public Property Title() As String

        Get

            Return _Title

        End Get

        Set(ByVal value As String)

            _Title = value

        End Set

    End Property

    Public Property Description() As String

        Get

            Return _Description

        End Get

        Set(ByVal value As String)

            _Description = value

        End Set

    End Property

    Public Property Path() As String

        Get

            Return _Path

        End Get

        Set(ByVal value As String)

            _Path = value

        End Set

    End Property

    Public Property Size() As Long

        Get

            Return _Size

        End Get

        Set(ByVal value As Long)

            _Size = value

        End Set

    End Property

End Class

Btw, if you bind the result to a DataGridView you can copy&paste from there into excel. Needo :-)

Cheers!

   Daniel

P.S. If you'd like to understand why you need the Imports <xmlns="http... at the beginning of the code check the follow-up article I wrote.

P.P.S. You can download the source code from the MSDN Code Gallery.

Edited April 29, 2009: Included the "Imports" statement and did some cleanup work.

Posted by Walzenbach | 3 Comments
Filed under: ,

Two free e-books available till April 22th to celebrate MS Press’s 25th b-day

2009 is the 25th anniversary of Microsoft Press! To celebrate their b-bay they’re giving away two free e-books, namely

clip_image002 clip_image003

Get them as soon as the offer lasts :-)

Daniel

More Posts Next page »
 
Page view tracker