Locations of visitors to this page


Onteora Software - July 2007

Onteora Software

Ken Tucker's Blog

About the author

Author Name is someone.
E-mail me Send mail

Recent posts

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Create a VS 2005 Debugging Visualizer

Create a VS 2005 Debugging Visualizer


Visual Studio 2005 visualizers allow you to see the data contained in a variable.  For this example we will create a visualizer to see the value of a guid.  To create a visualizer we need to start with a class library project.  Add a reference to Microsoft.VisualStudio.DebuggerVisualizers and System.Windows.Forms.  Set the build output path in the compile tab of my project to My Documents\Visual Studio 2005\Visualizers. 

.

Imports Microsoft.VisualStudio.DebuggerVisualizers
Imports System.Windows.Forms

<Assembly: DebuggerVisualizer(GetType(GuidVisualizer), target:=GetType(Guid), description:="Guid visualizer")>
Public Class GuidVisualizer
    Inherits DialogDebuggerVisualizer

    Protected Overrides Sub Show(ByVal windowService As Microsoft.VisualStudio.DebuggerVisualizers.IDialogVisualizerService, ByVal objectProvider As Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider)
        Dim g As Guid = CType(objectProvider.GetObject, Guid)
        MessageBox.Show(g.ToString)
    End Sub

End Class

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: VB | Debugging
Posted by Ken Tucker on Wednesday, July 04, 2007 10:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed

GotDotNet Phase out

GotDotNet Phase out


Since the GotDotNet website is being phased out I am placing my user samples here .

Video Capture Box

A inherted picturebox control which allows you to capture an image from a webcam. Also adds a ByteImage Property to make it easier to bind to an image from a database.


Enum Windows

A module you can add to your projects which contains an enum with all the WM_ messages. Good to use when overriding wndproc.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by Ken Tucker on Tuesday, July 03, 2007 10:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Change the DataType of a Column

Change the DataType of a Column


Sometimes when you fill a DataTable the .Net framework does not get the data type right.  Unfortunately once you fill a data table you can not change the data type.  You can use the data adapters FillScheme method to setup the data table this will allow you to be to change the data type.  Then you can fill the datatable with the data of the right type. .

VB Example
Dim conn As New SqlClient.SqlConnection("Server = .\sqlexpress; Database = NorthWind; " & _

"Integrated Security = sspi;")

Dim dt As New DataTable

Dim da As New SqlClient.SqlDataAdapter("Select * from [Order Details]", conn)

da.FillSchema(dt, SchemaType.Mapped)

dt.Columns("OrderID").DataType = GetType(Integer)

da.Fill(dt)



C# example

            SqlConnection  conn = new SqlConnection(
                 @"Server = .\sqlexpress; Database = NorthWind;Integrated Security  = sspi;");
            DataTable dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter("Select * from [Order Details]", conn);
            da.FillSchema(dt, SchemaType.Mapped);
            dt.Columns["OrderID"].DataType = typeof(int);
            da.Fill(dt);

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ado.Net | VB | C#
Posted by Ken Tucker on Monday, July 02, 2007 4:12 AM
Permalink | Comments (0) | Post RSSRSS comment feed