<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C#</title>
        <link>http://www.onteorasoftware.com/category/7.aspx</link>
        <description>C#</description>
        <language>en-US</language>
        <copyright>Ken Tucker</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <item>
            <title>Space Coast .Net Winter 09 Tiki Hut Tour</title>
            <link>http://blog.onteorasoftware.net/archive/2009/01/25/space-coast-.net-winter-09-tiki-hut-tour.aspx</link>
            <description>&lt;p&gt;
&lt;span&gt;&lt;span style="font-size: large; font-weight: bold; color: #ff0000"&gt;MSDN Tiki Hut Roadshow&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span class="timezone"&gt;Wednesday, February 18, 2009 6:30 PM - Wednesday, February 18, 2009 9:30 PM Eastern Time (US &amp;amp; Canada)&lt;/span&gt;
&lt;span class="timezone"&gt;
&lt;br /&gt;
Welcome Time: 6:00 PM&lt;/span&gt;
&lt;!-- start of Event address --&gt;
&lt;br /&gt;
&lt;span&gt;Space Coast Credit Union Corporate Headquarters&lt;/span&gt;
&lt;br /&gt;
&lt;span /&gt;
&lt;/p&gt;
&lt;div id="panLocationAddress"&gt;
&lt;span&gt;8045 N. Wickham Road&lt;br /&gt;
&lt;/span&gt;
&lt;span&gt;Melbourne&lt;/span&gt;
&lt;span&gt;Florida&lt;/span&gt;
&lt;span&gt;32940&lt;br /&gt;
&lt;/span&gt;
&lt;span&gt;United States&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
&lt;span&gt;&lt;strong&gt;Session 1 – jQuery with ASP.NET&lt;/strong&gt;
- JQuery is an open source JavaScript library that has a passionate
following among Ajax developers. Microsoft is integrating the open
source JQuery library into both the ASP.NET Web Forms and ASP.NET MVC
frameworks and providing full product support. Learn how you can take
advantage of JQuery to build richly interactive client-side Ajax
applications when developing either ASP.NET Web Forms or ASP.NET MVC
applications. Also see how JQuery works in combination with ASP.NET
AJAX to provide the best framework for building Ajax applications.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Session 2 – Data Services&lt;/strong&gt; - OnPremise and Off -
In the near future, applications will be developed using a combination
of custom application code and online building block services,
including data-centric services. In this session we discuss
advancements in the Microsoft development platform and online service
interfaces to enable seamless interaction with data services both
on-premises (e.g., ADO.NET Data Services Framework over on-premises SQL
Server) and in the cloud (e.g., SQL Server Data Services). Learn how
you can leverage existing know-how related to LINQ (Language Integrated
Query), data access APIs, data-binding, and more when building
applications using online data.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Session 3 – Architecting for the Cloud using Windows Azure&lt;/strong&gt;
- This session provides a tour of the Windows Azure cloud computing
platform, an overview of its various components, and explains how these
fit together to provide best-of-cloud experiences. We will explore the
architecture that links many of the Microsoft .NET services and lets
ISVs and businesses deliver compelling solutions. Learn how to compose
these services with SQL Data Services to create applications in the
cloud and connect them with on-premise systems. We will also examine
the next generation of messaging, data, access control, and directory
services, and how they fit together to provide a seamless integration
into the cloud.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Speaker’s Bios:&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Joe Healy &lt;/strong&gt;( &lt;a href="http://www.devfish.net/"&gt;http://www.devfish.net&lt;/a&gt;
) is the Developer Evangelist for Microsoft Gulf States Accounts, based
out of Tampa Florida. Joe’s geographical responsibility is to provide
‘developer care’ for the state of Florida. Joe serves a multitude of
clients, from corporate accounts to broad reach events and User Groups.
He lectures on various development and architectural topics focused
around the .Net Frameworks, Visual Studio.NET, and associated servers.
Joe has also served time with eAngler.com, Arthur Andersen, Cap Gemini,
EDS, and IBM in various capacities.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Jeff Barnes&lt;/strong&gt; (Architecture: The Harmony of Mathematical Precision; 
&lt;a href="http://blogs.msdn.com/jbarnes"&gt;http://blogs.msdn.com/jbarnes&lt;/a&gt;
) is the Microsoft Architect Evangelist for the Gulf States District
where he engages with the local Architect community to help solve tough
business problems with leading-edge technology. Jeff has been with
Microsoft for over 10 years and has spent over 7 of those years as an
architect in the Microsoft Consulting Services organization working
with large enterprise customers throughout North America. He especially
enjoys the freedom and flexibility that .NET brings to the table in
order solve the next generation of tough technical challenges.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Register if you plan to attend this event
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032400629&amp;amp;culture=en-US"&gt; https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032400629&amp;amp;culture=en-US&lt;/a&gt;
&lt;/p&gt;
&lt;span /&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/7.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2009/01/25/space-coast-.net-winter-09-tiki-hut-tour.aspx</guid>
            <pubDate>Sun, 25 Jan 2009 12:47:20 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/7.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2009/01/25/space-coast-.net-winter-09-tiki-hut-tour.aspx#feedback</comments>
            <slash:comments>42</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/7.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Uploading a Database to Dotster</title>
            <link>http://blog.onteorasoftware.net/archive/2008/03/12/uploading-a-database-to-dotster.aspx</link>
            <description>&lt;p&gt;
The easiest way to upload a database to dotster is to use the &lt;a href="http://www.codeplex.com/sqlhost"&gt;sql hosting toolkit&lt;/a&gt;.   Visual studio 2008 installs the sql hosting toolkit for you otherwise you need to download and install from the link.  
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Steps to do this
&lt;/p&gt;
&lt;p&gt;
1) Create a database in the dotster control panel.
&lt;/p&gt;
&lt;p&gt;
2) In the server explorer create a link to the database you want to upload.  
&lt;/p&gt;
&lt;p&gt;
3) Right click on the database and select publish to provider in the wizard make sure you select sql 2000 as the target database schema.
&lt;/p&gt;
&lt;p&gt;
4) On the codeplex website they use to have a webpage available to use to help run the script to create your database.  Now they have a webservice for this.   I kind of think the webservice is over kill to just publish 1 database.  So create a c# website which targets the .net framework 2.0
&lt;/p&gt;
&lt;p&gt;
5) Add the script file you created in step 3 to the website.
&lt;/p&gt;
&lt;p&gt;
6) Add the following code to webpage
&lt;/p&gt;
&lt;p&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Configuration;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Web.Security;&lt;br /&gt;
using System.Web.UI;&lt;br /&gt;
using System.Web.UI.HtmlControls;&lt;br /&gt;
using System.Web.UI.WebControls;&lt;br /&gt;
using System.Web.UI.WebControls.WebParts;
&lt;/p&gt;
&lt;p&gt;
namespace WebApplication3&lt;br /&gt;
{&lt;br /&gt;
    public partial class _Default : System.Web.UI.Page&lt;br /&gt;
    {&lt;br /&gt;
        protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            string fileName = Server.MapPath(&lt;font face="Lucida Console" size="2"&gt;@"&amp;lt;&amp;lt;YOUR_SCRIPTFILE&amp;gt;&amp;gt;&lt;/font&gt;.SQL");
&lt;/p&gt;
&lt;p&gt;
            // Connection string to the server you want to execute against&lt;br /&gt;
            string connectionString = &lt;font face="Lucida Console" size="2"&gt;@"Server=&amp;lt;&amp;lt;YOUR_SERVER&amp;gt;&amp;gt;;User ID=&amp;lt;&amp;lt;YOUR_USERNAME&amp;gt;&amp;gt;;Password=&amp;lt;&amp;lt;YOUR_PASSWORD&amp;gt;&amp;gt;;Initial Catalog=&amp;lt;&amp;lt;YOUR_DATABASE&amp;gt;&amp;gt;";&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
            // Timeout of batches (in seconds)&lt;br /&gt;
            int timeout = 600;
&lt;/p&gt;
&lt;p&gt;
            SqlConnection conn = null;&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                Response.Write(String.Format("Opening file {0}&amp;lt;BR&amp;gt;", fileName));
&lt;/p&gt;
&lt;p&gt;
                // read file&lt;br /&gt;
                using (StreamReader sr = new StreamReader(new FileStream(fileName, FileMode.Open)))&lt;br /&gt;
                {&lt;br /&gt;
                    Response.Write("Connecting to SQL Server database...&amp;lt;BR&amp;gt;");
&lt;/p&gt;
&lt;p&gt;
                    // Create new connection to database&lt;br /&gt;
                    conn = new SqlConnection(connectionString);
&lt;/p&gt;
&lt;p&gt;
                    conn.Open();
&lt;/p&gt;
&lt;p&gt;
                    while (!sr.EndOfStream)&lt;br /&gt;
                    {&lt;br /&gt;
                        StringBuilder sb = new StringBuilder();&lt;br /&gt;
                        SqlCommand cmd = conn.CreateCommand();
&lt;/p&gt;
&lt;p&gt;
                        while (!sr.EndOfStream)&lt;br /&gt;
                        {&lt;br /&gt;
                            string s = sr.ReadLine();&lt;br /&gt;
                            if (s != null &amp;amp;&amp;amp; s.ToUpper().Trim().Equals("GO"))&lt;br /&gt;
                            {&lt;br /&gt;
                                break;&lt;br /&gt;
                            }
&lt;/p&gt;
&lt;p&gt;
                            sb.AppendLine(s);&lt;br /&gt;
                        }
&lt;/p&gt;
&lt;p&gt;
                        // Execute T-SQL against the target database&lt;br /&gt;
                        try&lt;br /&gt;
                        {&lt;br /&gt;
                            cmd.CommandText = sb.ToString();&lt;br /&gt;
                            cmd.CommandTimeout = timeout;
&lt;/p&gt;
&lt;p&gt;
                            cmd.ExecuteNonQuery();
&lt;/p&gt;
&lt;p&gt;
                        }&lt;br /&gt;
                        catch (Exception ex)&lt;br /&gt;
                        {&lt;br /&gt;
                            Response.Write(sb.ToString().Replace("\n", @"&amp;lt;br/&amp;gt;"));&lt;br /&gt;
                            Response.Write(ex.Message.ToString() + @"&amp;lt;br /&amp;gt;");&lt;br /&gt;
                        }&lt;br /&gt;
                    }
&lt;/p&gt;
&lt;p&gt;
                }&lt;br /&gt;
                Response.Write("T-SQL file executed successfully");&lt;br /&gt;
            }&lt;br /&gt;
            catch (Exception ex)&lt;br /&gt;
            {&lt;br /&gt;
                Response.Write(String.Format("An error occured: {0}", ex.ToString()));&lt;br /&gt;
            }&lt;br /&gt;
            finally&lt;br /&gt;
            {&lt;br /&gt;
                // Close out the connection&lt;br /&gt;
                //&lt;br /&gt;
                if (conn != null)&lt;br /&gt;
                {&lt;br /&gt;
                    try&lt;br /&gt;
                    {&lt;br /&gt;
                        conn.Close();&lt;br /&gt;
                        conn.Dispose();&lt;br /&gt;
                    }&lt;br /&gt;
                    catch (Exception e1)&lt;br /&gt;
                    {&lt;br /&gt;
                        Response.Write(String.Format(@"Could not close the connection.  Error was {0}", e1.ToString()));&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }
&lt;/p&gt;
&lt;p&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
Uploasd the website to dotster and open the webpage and your database should be copied to the new database.  Make sure you delete the website after you created the database to prevent someone from accidently undo changes to the database after you uploaded it.
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/31.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2008/03/12/uploading-a-database-to-dotster.aspx</guid>
            <pubDate>Thu, 13 Mar 2008 02:39:16 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/31.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2008/03/12/uploading-a-database-to-dotster.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/31.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Change the DataType of a Column</title>
            <link>http://blog.onteorasoftware.net/archive/2007/12/05/change-the-datatype-of-a-column.aspx</link>
            <description>&lt;h3 align="center"&gt;Change the DataType of a Column&lt;/h3&gt;
&lt;p&gt;
&lt;br /&gt;
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. .&lt;br /&gt;
&lt;br /&gt;
VB Example&lt;br /&gt;
&lt;font size="2" /&gt;&lt;font size="2" color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; conn &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;New&lt;/font&gt;&lt;font size="2"&gt; SqlClient.SqlConnection(&lt;/font&gt;&lt;font size="2" color="#a31515"&gt;"Server = .\sqlexpress; Database = NorthWind; "&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; _&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;
&lt;font size="2" color="#a31515"&gt;"Integrated Security = sspi;"&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; dt &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;New&lt;/font&gt;&lt;font size="2"&gt; DataTable&lt;/font&gt;&lt;font size="2" /&gt;&lt;font size="2" color="#0000ff" /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2" color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; da &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;New&lt;/font&gt;&lt;font size="2"&gt; SqlClient.SqlDataAdapter(&lt;/font&gt;&lt;font size="2" color="#a31515"&gt;"Select * from [Order Details]"&lt;/font&gt;&lt;font size="2"&gt;, conn)&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;
da.FillSchema(dt, SchemaType.Mapped)
&lt;/p&gt;
dt.Columns(&lt;/font&gt;&lt;font size="2" color="#a31515"&gt;"OrderID"&lt;/font&gt;&lt;font size="2"&gt;).DataType = &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;GetType&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;Integer&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;
da.Fill(dt)
&lt;/p&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
C# example&lt;br /&gt;
&lt;br /&gt;
            SqlConnection  conn = new SqlConnection(&lt;br /&gt;
                 @"Server = .\sqlexpress; Database = NorthWind;Integrated Security  = sspi;");&lt;br /&gt;
            DataTable dt = new DataTable();&lt;br /&gt;
            SqlDataAdapter da = new SqlDataAdapter("Select * from [Order Details]", conn);&lt;br /&gt;
            da.FillSchema(dt, SchemaType.Mapped);&lt;br /&gt;
            dt.Columns["OrderID"].DataType = typeof(int);&lt;br /&gt;
            da.Fill(dt);
&lt;/p&gt;
&lt;font size="2" color="#0000ff" /&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/60.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/12/05/change-the-datatype-of-a-column.aspx</guid>
            <pubDate>Wed, 05 Dec 2007 13:29:04 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/60.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/12/05/change-the-datatype-of-a-column.aspx#feedback</comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/60.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Draw an Icon in a DataGridViewButtonCell</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/draw-an-icon-in-a-datagridviewbuttoncell.aspx</link>
            <description>&lt;h3 align="center"&gt;Draw an Icon in a DataGridViewButtonCell&lt;/h3&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
Here is a simple example on how to draw in a DataGridViewButtonCell. In this example an icon is displayed when button is pushed and the icon is made invisible when its pushed again. I am storing the if the button has been pressed in the cell's tag. I use the cellPainting event to draw the icon when needed. 
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
using System; &lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;
&lt;/p&gt;
&lt;p&gt;
namespace CSButtonColumn&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            String strConn = "Server = .\\SqlExpress;Database = Pubs;Integrated Security = SSPI;";&lt;br /&gt;
            DataTable dt = new DataTable();&lt;br /&gt;
            SqlConnection conn = new SqlConnection(strConn);&lt;br /&gt;
            SqlDataAdapter da = new SqlDataAdapter("Select * from titles", conn);&lt;br /&gt;
            da.Fill(dt);&lt;br /&gt;
            dataGridView1.DataSource = dt;&lt;br /&gt;
            DataGridViewButtonColumn bc = new DataGridViewButtonColumn();&lt;br /&gt;
            bc.Tag = false;&lt;br /&gt;
            dataGridView1.Columns.Insert(0, bc);&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            if (e.ColumnIndex == 0)&lt;br /&gt;
            {&lt;br /&gt;
                e.Value = "Repair";&lt;br /&gt;
                e.FormattingApplied = true;&lt;br /&gt;
            }&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            if (e.ColumnIndex == 0 &amp;amp;&amp;amp; e.RowIndex &amp;gt;= 0)&lt;br /&gt;
            {&lt;br /&gt;
                e.Paint(e.CellBounds, DataGridViewPaintParts.All);&lt;br /&gt;
                DataGridViewButtonCell bc = dataGridView1[0, e.RowIndex] as DataGridViewButtonCell;&lt;br /&gt;
                bool x;&lt;br /&gt;
                if (bc.Tag == null)&lt;br /&gt;
                {&lt;br /&gt;
                    x = false;&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    x = (bool)bc.Tag;&lt;br /&gt;
                }&lt;br /&gt;
                if (x)&lt;br /&gt;
                {&lt;br /&gt;
                    Icon ico = new Icon("repair.ico");&lt;br /&gt;
                    e.Graphics.DrawIcon(ico, e.CellBounds.Left+3, e.CellBounds.Top+3 );&lt;br /&gt;
                }&lt;br /&gt;
                e.Handled = true;&lt;br /&gt;
            }&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            if (e.ColumnIndex == 0 &amp;amp;&amp;amp; e.RowIndex &amp;gt;= 0)&lt;br /&gt;
            {&lt;br /&gt;
                DataGridViewButtonCell bc = dataGridView1[e.ColumnIndex, e.RowIndex] as DataGridViewButtonCell;&lt;br /&gt;
                if (bc.Tag == null)&lt;br /&gt;
                {&lt;br /&gt;
                    bc.Tag = true;&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    bc.Tag = !(bool)bc.Tag;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/82.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/draw-an-icon-in-a-datagridviewbuttoncell.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 19:25:25 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/82.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/draw-an-icon-in-a-datagridviewbuttoncell.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/82.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Datagrid Validation</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/datagrid-validation.aspx</link>
            <description>&lt;h3 align="center"&gt;Datagrid Validation&lt;/h3&gt;&lt;br /&gt;
&lt;p&gt;
The DataGridView has a &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvalidating(VS.80).aspx"&gt;CellValidating Event&lt;/a&gt; to validate the data entered. Here is how to do it with the DataGrid. 
&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
There are 2 method to do this. My method is to add a tablestyle to the datagrid. For the cells I want to validate I handle the DataGridTextBoxColumn's Textbox's Validate event. George Shepherd's method is use the CurrentCellChanged event. You can read about this method in the &lt;a href="http://windowsforms.net/FAQs/default.aspx?PageID=2&amp;amp;ItemID=550&amp;amp;CategoryID=3&amp;amp;tabindex=3"&gt;Windows Forms FAQ.&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;
&lt;/p&gt;
&lt;p&gt;
namespace CSDatagrid&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            String strConn = "Server = .\\SqlExpress;Database = Pubs;Integrated Security = SSPI;";&lt;br /&gt;
            DataTable dt = new DataTable();&lt;br /&gt;
            SqlConnection conn = new SqlConnection(strConn);&lt;br /&gt;
            SqlDataAdapter da = new SqlDataAdapter("Select Title, price from titles", conn);&lt;br /&gt;
            da.Fill(dt);&lt;br /&gt;
            dataGrid1.DataSource = dt;&lt;br /&gt;
            CurrencyManager cm = this.BindingContext[dt] as CurrencyManager;&lt;br /&gt;
            PropertyDescriptor pd = cm.GetItemProperties()["price"];
&lt;/p&gt;
&lt;p&gt;
            DataGridTableStyle ts = new DataGridTableStyle();&lt;br /&gt;
            ts.MappingName = dt.TableName;
&lt;/p&gt;
&lt;p&gt;
            DataGridTextBoxColumn tcTitle = new DataGridTextBoxColumn();&lt;br /&gt;
            tcTitle.MappingName = "Title";&lt;br /&gt;
            tcTitle.HeaderText = "Title";&lt;br /&gt;
            tcTitle.Width = 250;&lt;br /&gt;
            DataGridTextBoxColumn tcPrice = new DataGridTextBoxColumn(pd, "c2");&lt;br /&gt;
            tcPrice.MappingName = "price";&lt;br /&gt;
            tcPrice.HeaderText = "Book Price";&lt;br /&gt;
            tcPrice.Width = 100;&lt;br /&gt;
            tcPrice.TextBox.Validating += new CancelEventHandler(TextBox_Validating);&lt;br /&gt;
            ts.GridColumnStyles.Add(tcTitle);&lt;br /&gt;
            ts.GridColumnStyles.Add(tcPrice);
&lt;/p&gt;
&lt;p&gt;
            dataGrid1.TableStyles.Add(ts);&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        void TextBox_Validating(Object sender, CancelEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            TextBox txt = (TextBox)sender;&lt;br /&gt;
            txt.Text = txt.Text.Replace("$", "");&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
You will find a VB example on the &lt;a href="http://www.vb-tips.com/dbpages.aspx?ID=bece831d-6742-4364-bd0d-203ca99d2825"&gt;VB-Tips Website&lt;/a&gt; 
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/89.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/datagrid-validation.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 19:05:42 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/89.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/datagrid-validation.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/89.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Printer Compatibility Library 1.0</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/printer-compatibility-library-1.0.aspx</link>
            <description>&lt;h3 align="center"&gt;Printer Compatibility Library 1.0&lt;/h3&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
Visual Basic 6.0 and earlier had a printer object which made it simple to print. The &lt;a href="http://msdn2.microsoft.com/en-us/vbasic/bb219077.aspx"&gt;Printer Compatibility Library 1.0&lt;/a&gt; makes it possible to use the same object with VB or C# 2005. After installing the Power Pack just add a reference to Microsoft.VisualBasic.PowerPacks.Printing.Printer 
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
VB Sample 
&lt;/p&gt;
&lt;p&gt;
Imports Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
&lt;/p&gt;
&lt;p&gt;
Public Class Form1
&lt;/p&gt;
&lt;p&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim p As New Printer&lt;br /&gt;
        p.Print("Page 1")&lt;br /&gt;
        p.NewPage()&lt;br /&gt;
        p.Print("Page 2")&lt;br /&gt;
        p.EndDoc()&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
C# Sample 
&lt;/p&gt;
&lt;p&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6;
&lt;/p&gt;
&lt;p&gt;
namespace PrinterCS&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            Printer p = new Printer();&lt;br /&gt;
            p.Print("Page 1");&lt;br /&gt;
            p.NewPage();&lt;br /&gt;
            p.Print("Page 2");&lt;br /&gt;
            p.EndDoc();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/88.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/printer-compatibility-library-1.0.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 19:04:51 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/88.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/printer-compatibility-library-1.0.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/88.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Data From Multiple Tables in a DataGridView</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/data-from-multiple-tables-in-a-datagridview.aspx</link>
            <description>&lt;h3 align="center"&gt;Data From Multiple Tables in a DataGridView&lt;/h3&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
There is &lt;a href="http://support.microsoft.com/kb/325682"&gt;Msdn Knowledge base article&lt;/a&gt; which shows how to create a JoinView class. The JoinView class is for joining 2 tables together for data binding. Basically you load 2 or more tables into a dataset and set up some data relations for the related tables. When you create the Joinview the first argument is the main table, 2nd is a list of fields you want to show, 3rd is a filter, and 4th is the field to sort on. The last 2 arguments are option. Since the article includes a vb sample I am posting a c# example. I would recommend compiling JoinView.VB into a class so you use it with c#. I named my dll MSDNClasses. 
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using MSDNClasses;
&lt;/p&gt;
&lt;p&gt;
namespace CSDGVMultiTable&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        DataSet ds = new DataSet();&lt;br /&gt;
        JoinView jv;
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            SqlConnection conn = new SqlConnection(@"server=.\sqlexpress;integrated security=true;database=northwind");&lt;br /&gt;
            SqlDataAdapter daCust = new SqlDataAdapter(@"Select * From Customers", conn);&lt;br /&gt;
            SqlDataAdapter daEmp = new SqlDataAdapter(@"Select * From Employees", conn);&lt;br /&gt;
            SqlDataAdapter daOrd = new SqlDataAdapter(@"Select * From Orders", conn);
&lt;/p&gt;
&lt;p&gt;
            daCust.Fill(ds, "Cust");&lt;br /&gt;
            daEmp.Fill(ds, "Emp");&lt;br /&gt;
            daOrd.Fill(ds, "Ord");
&lt;/p&gt;
&lt;p&gt;
            // Create some data relations for the joinview to use
&lt;/p&gt;
&lt;p&gt;
            ds.Relations.Add("CustOrd", ds.Tables["Cust"].Columns["CustomerID"], ds.Tables["Ord"].Columns["CustomerID"]);&lt;br /&gt;
            ds.Relations.Add("EmpOrd", ds.Tables["Emp"].Columns["EmployeeID"], ds.Tables["Ord"].Columns["EmployeeID"]);
&lt;/p&gt;
&lt;p&gt;
            // Create Join View&lt;br /&gt;
            // Select fields for JoinView,  a filter to use, and Column to sort on
&lt;/p&gt;
&lt;p&gt;
            jv = new JoinView(ds.Tables["Ord"],&lt;br /&gt;
                "OrderID,CustomerID,EmployeeID,OrderDate,CustOrd.CompanyName Company,CustOrd.ContactName Contact,CustOrd.ContactTitle Position,EmpOrd.FirstName,EmpOrd.LastName",&lt;br /&gt;
                "", "");
&lt;/p&gt;
&lt;p&gt;
            dataGridView1.DataSource = jv;
&lt;/p&gt;
&lt;p&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/86.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/data-from-multiple-tables-in-a-datagridview.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 19:02:45 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/86.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/data-from-multiple-tables-in-a-datagridview.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/86.aspx</wfw:commentRss>
        </item>
        <item>
            <title>AutoComplete in DataGridView</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/autocomplete-in-datagridview.aspx</link>
            <description>&lt;h3 align="center"&gt;AutoComplete in DataGridView&lt;/h3&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
In the datagridview's editing control showing event you have better access to the textboxes properties. Here is an example of adding autocomplete to the textbox. 
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
VB Sample 
&lt;/p&gt;
&lt;p&gt;
Imports System.Data.SqlClient
&lt;/p&gt;
&lt;p&gt;
Public Class Form1
&lt;/p&gt;
&lt;p&gt;
    Dim scAutoComplete As New AutoCompleteStringCollection
&lt;/p&gt;
&lt;p&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim strConn As String&lt;br /&gt;
        Dim da As SqlDataAdapter&lt;br /&gt;
        Dim conn As SqlConnection&lt;br /&gt;
        Dim ds As New DataSet&lt;br /&gt;
        strConn = "Server = .;Database = NorthWind; Integrated Security = SSPI;"&lt;br /&gt;
        conn = New SqlConnection(strConn)&lt;br /&gt;
        da = New SqlDataAdapter("Select * from [Orders]", conn)&lt;br /&gt;
        da.Fill(ds, "Orders")&lt;br /&gt;
        DataGridView1.DataSource = ds.Tables("Orders")
&lt;/p&gt;
&lt;p&gt;
        Dim cmd As New SqlCommand("Select CustomerID From customers", conn)&lt;br /&gt;
        Dim dr As SqlDataReader
&lt;/p&gt;
&lt;p&gt;
        conn.Open()&lt;br /&gt;
        dr = cmd.ExecuteReader&lt;br /&gt;
        Do While dr.Read&lt;br /&gt;
            scAutoComplete.Add(dr.GetString(0))&lt;br /&gt;
        Loop&lt;br /&gt;
        conn.Close()&lt;br /&gt;
    End Sub
&lt;/p&gt;
&lt;p&gt;
    Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing&lt;br /&gt;
        If DataGridView1.CurrentCell.ColumnIndex = 1 AndAlso TypeOf e.Control Is TextBox Then&lt;br /&gt;
            With DirectCast(e.Control, TextBox)&lt;br /&gt;
                .AutoCompleteMode = AutoCompleteMode.SuggestAppend&lt;br /&gt;
                .AutoCompleteSource = AutoCompleteSource.CustomSource&lt;br /&gt;
                .AutoCompleteCustomSource = scAutoComplete&lt;br /&gt;
            End With&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
C# Sample 
&lt;/p&gt;
&lt;p&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data.SqlClient;
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
namespace DGCAutoComplete&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        AutoCompleteStringCollection scAutoComplete = new AutoCompleteStringCollection();
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            DataTable dt = new DataTable();&lt;br /&gt;
            String strConn = "Server = .;Database = NorthWind; Integrated Security = SSPI;";&lt;br /&gt;
            SqlConnection conn = new SqlConnection(strConn);&lt;br /&gt;
            SqlDataAdapter da = new SqlDataAdapter("Select * from [Orders]", conn);&lt;br /&gt;
            da.Fill(dt);&lt;br /&gt;
            dataGridView1.DataSource = dt;&lt;br /&gt;
            SqlCommand cmd = new SqlCommand("Select CustomerID From customers", conn);&lt;br /&gt;
            SqlDataReader dr;&lt;br /&gt;
                conn.Open();&lt;br /&gt;
                dr=cmd.ExecuteReader();&lt;br /&gt;
                while(dr.Read())&lt;br /&gt;
                {&lt;br /&gt;
                    scAutoComplete.Add(dr.GetString(0));&lt;br /&gt;
                }&lt;br /&gt;
                conn.Close();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            if (dataGridView1.CurrentCellAddress.X == 1)&lt;br /&gt;
            {&lt;br /&gt;
                TextBox txt = e.Control as TextBox;&lt;br /&gt;
                txt.AutoCompleteCustomSource = scAutoComplete;&lt;br /&gt;
                txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend;&lt;br /&gt;
                txt.AutoCompleteSource = AutoCompleteSource.CustomSource;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/94.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/autocomplete-in-datagridview.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 19:00:07 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/94.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/autocomplete-in-datagridview.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/94.aspx</wfw:commentRss>
        </item>
        <item>
            <title>.Net Framework 3.0 Text to Speech</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/.net-framework-3.0-text-to-speech.aspx</link>
            <description>&lt;h3 align="center"&gt;.Net Framework 3.0 Text to Speech&lt;/h3&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
The dot net framework 3.0 now has a managed provider for text to speech. I tested this app on a machine with windows xp service pack 2 and the &lt;a href="http://msdn.microsoft.com/windowsvista/downloads/products/getthebeta/#runWinFXApps"&gt;Dot Net FrameWork 3.0 RC1.&lt;/a&gt; The link is to set up instructions for the .net framework 3.0 
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
For this sample add a reference to system.speech, place a textbox named txtSay, a button named btnSay, and listbox named lstVoice. The application fills a list box with the installed voices on the system at startup. When you click on the button it says the text in the textbox with the selected voice. 
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
VB Sample 
&lt;/p&gt;
&lt;p&gt;
Imports System.Speech.Synthesis
&lt;/p&gt;
&lt;p&gt;
Public Class Form1
&lt;/p&gt;
&lt;p&gt;
    Private Sub btnSay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSay.Click&lt;br /&gt;
        Dim spk As New SpeechSynthesizer&lt;br /&gt;
        spk.SelectVoice(lstVoice.SelectedItem.ToString)&lt;br /&gt;
        spk.Speak(txtSay.Text)&lt;br /&gt;
    End Sub
&lt;/p&gt;
&lt;p&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        Dim spk As New SpeechSynthesizer&lt;br /&gt;
        For Each voice As InstalledVoice In spk.GetInstalledVoices&lt;br /&gt;
            lstVoice.Items.Add(voice.VoiceInfo.Name)&lt;br /&gt;
        Next&lt;br /&gt;
        lstVoice.SelectedIndex = 0&lt;br /&gt;
        txtSay.Text = "Hello World!"&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;p&gt;
C# Sample 
&lt;/p&gt;
&lt;p&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Speech.Synthesis;
&lt;/p&gt;
&lt;p&gt;
namespace CS3._Speech&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            SpeechSynthesizer spk = new SpeechSynthesizer();&lt;br /&gt;
            foreach(InstalledVoice voice in spk.GetInstalledVoices())&lt;br /&gt;
            {&lt;br /&gt;
                lstVoice.Items.Add(voice.VoiceInfo.Name);&lt;br /&gt;
            }&lt;br /&gt;
            lstVoice.SelectedIndex = 0;&lt;br /&gt;
            txtSay.Text = "Hello World";&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void btnSay_Click(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            SpeechSynthesizer spk = new SpeechSynthesizer();
&lt;/p&gt;
&lt;p&gt;
            spk.SelectVoice(lstVoice.SelectedItem.ToString());&lt;br /&gt;
            spk.Speak(txtSay.Text);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/95.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/.net-framework-3.0-text-to-speech.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 18:57:48 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/95.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/.net-framework-3.0-text-to-speech.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/95.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Secure Strings</title>
            <link>http://blog.onteorasoftware.net/archive/2007/09/16/secure-strings.aspx</link>
            <description>&lt;h3 align="center"&gt;Secure Strings&lt;/h3&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
The SecureString is a new class that was added in the .Net framework 2.0 which allows you to store info in memory securely. The SecureString could be used to safely secure a password or credit number. The example shows how to add info to the string, prevent changes from being make to the data, and finally how to get the info back. I included c# and VB samples. 
&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;
C# sample 
&lt;/p&gt;
&lt;p&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Security;&lt;br /&gt;
using System.Runtime.InteropServices;
&lt;/p&gt;
&lt;p&gt;
namespace SecureStringCS&lt;br /&gt;
{&lt;br /&gt;
    public partial class Form1 : Form&lt;br /&gt;
    {&lt;br /&gt;
        public Form1()&lt;br /&gt;
        {&lt;br /&gt;
            InitializeComponent();&lt;br /&gt;
        }
&lt;/p&gt;
&lt;p&gt;
        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            //&lt;br /&gt;
            // How to add to a secure string&lt;br /&gt;
            //&lt;br /&gt;
            SecureString ss = new SecureString();&lt;br /&gt;
            foreach (Char c in "This is some info I need to keep secure".ToCharArray())&lt;br /&gt;
            {&lt;br /&gt;
                ss.AppendChar(c);&lt;br /&gt;
            }&lt;br /&gt;
            //&lt;br /&gt;
            // Prevent changes&lt;br /&gt;
            //&lt;br /&gt;
            ss.MakeReadOnly();
&lt;/p&gt;
&lt;p&gt;
            //&lt;br /&gt;
            // How to get the info back&lt;br /&gt;
            //
&lt;/p&gt;
&lt;p&gt;
            IntPtr ptr;&lt;br /&gt;
            ptr=Marshal.SecureStringToBSTR(ss);
&lt;/p&gt;
&lt;p&gt;
            String s;&lt;br /&gt;
            s = Marshal.PtrToStringAuto(ptr);&lt;br /&gt;
            Marshal.ZeroFreeBSTR(ptr);
&lt;/p&gt;
&lt;p&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
VB sample 
&lt;/p&gt;
&lt;p&gt;
Imports System.Security&lt;br /&gt;
Imports System.Runtime.InteropServices
&lt;/p&gt;
&lt;p&gt;
Public Class Form1
&lt;/p&gt;
&lt;p&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
&lt;/p&gt;
&lt;p&gt;
        '&lt;br /&gt;
        ' how to add to a secure string&lt;br /&gt;
        '&lt;br /&gt;
        Dim ss As New SecureString&lt;br /&gt;
        For Each c As Char In "This is some info I need to keep secure".ToCharArray&lt;br /&gt;
            ss.AppendChar(c)&lt;br /&gt;
        Next
&lt;/p&gt;
&lt;p&gt;
        ' prevent changes
&lt;/p&gt;
&lt;p&gt;
        ss.MakeReadOnly()
&lt;/p&gt;
&lt;p&gt;
        '&lt;br /&gt;
        ' how to get the info back&lt;br /&gt;
        '&lt;br /&gt;
        Dim ptr As IntPtr&lt;br /&gt;
        ptr = Marshal.SecureStringToBSTR(ss)&lt;br /&gt;
        Dim s As String
&lt;/p&gt;
&lt;p&gt;
        s = Marshal.PtrToStringAuto(ptr)&lt;br /&gt;
        Marshal.ZeroFreeBSTR(ptr)
&lt;/p&gt;
&lt;p&gt;
    End Sub&lt;br /&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
 
&lt;/p&gt;
&lt;img src="http://blog.onteorasoftware.net/aggbug/99.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ken Tucker</dc:creator>
            <guid>http://blog.onteorasoftware.net/archive/2007/09/16/secure-strings.aspx</guid>
            <pubDate>Sun, 16 Sep 2007 18:54:41 GMT</pubDate>
            <wfw:comment>http://blog.onteorasoftware.net/comments/99.aspx</wfw:comment>
            <comments>http://blog.onteorasoftware.net/archive/2007/09/16/secure-strings.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.onteorasoftware.net/comments/commentRss/99.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>