Wednesday, September 20, 2017

Duke University visit with SW Dance Team

The Southwest dance team recently enjoyed the opportunity to cheer or dance (not sure which) on the field at half time during the Duke vs Baylor football game over the weekend.  I may have been a long day for such a short performance, but it was a great experience... visiting the campus, enjoying the game and watch Caitlin and the girls take the field at half time.

The game was fun.  There was a good crowd there and it was quite warm for a mid September afternoon, they had tables around the stadium handing out free paper drink cups with ice water.  Luckily we were seated with the sun to our backs.  There were several dance/cheer teams that took the field, it was a busy time.  Of course being from Eastern PA, football is often more about the band, then the game, and Kim enjoyed watching the band perform.

Walking around campus was sorta OK, but I heard they have an old time cathedral that is just fantastic.  To visit the cathedral, it is open for self guided tours, but if you luck out and there is a custodian there by the name of Oscar, be sure to stop and ask him a few questions about the cathedral.  Before you know it, he will have shared with you all kinds of interesting facts about the school, the cathedral and him self.  What a wonderful gentlemen and a good time and visit we had.











The cathedral at Duke University
Click  an image and view them full screen.
Have I mentioned I love my G6 Phone Camera...

    

    

    

    

    

    

    

    



    
   


Caitlin and SW Dance Team on the field
Click  an image and view them full screen.

    

    

Caitlin hamming it up...

    


    


Monday, September 11, 2017

Using

Using .Net.  No, I am not referring to drug that I am using called .NET, but the Using statement in the .NET framework.  The “Using” statement in .NET framework provides a convenient syntax that ensures the correct use of IDisposable objects.

If .NET object you are using implements IDisposable, then you can simply call the Dispose method your self

    ReportDocument report = new ReportDocument();

    // do something with the report

    report.Close();
    report.Dispose();

But what if an exception happens when you are doing something with the report? The .Close and .Dispose methods will never be called.

Or you could also use a Try Catch block, and in the catch perform the .Close and .Dispose

    ReportDocument report = new ReportDocument();

    try
    {
        // do something with the report

    }
    catch (Exception)
    {
        report.Close();
        report.Dispose();

        throw;
    }

But this does become verbose and it requires you to remember the try/catch and add the close and/or dispose methods.

Now, with the Using statement, it looks like this.

    using (ReportDocument report = new ReportDocument())
    {
        // do something with the report
    }

This Using block, will instantiate the report object, and when you are done doing something with that report object, it will properly dispose of the object, and IF the object has a .close method, the Dispose method will perform the Close and then Dispose.  Now... depending on your object and what you are doing with the "do something here", you may still want to put this Using inside a Try/Catch.

You can also nest Using statements. Below is an example of this, and putting it all in a Try/Catch block.

    try
    {
        using (DataSet ds = new DataSet())
        using (SqlConnection sqlConnection = GetWebOrdersConnection())
        using (SqlDataAdapter da = new SqlDataAdapter(sql, sqlConnection))
        {
            da.Fill(ds, "MyTable");
            if (ds.Tables[0].Rows.Count == 1)
            {
                result = true;
            }
        }
    }
    catch (Exception)
    {
        throw;
    }

In VB.Net it is a bit more verbose, but it all works the same. Below is an example in VB.Net, with out the Try/Catch.

    Using ds As New System.Data.DataSet
        Using conn As System.Data.SqlClient.SqlConnection = WebOrdersService.GetWebOrdersConnection
            Using da As New System.Data.SqlClient.SqlDataAdapter(wrksqlstm, conn)
                da.Fill(ds, "Apps")
            End Using
        End Using
    End Using



Tuesday, September 5, 2017

Labor Day on the New River bike trail

Where we rode the New River Bike Trail.
Over Labor Day weekend we drove up to a friends place, Brian and Terry Timmerman, near Galax VA for a bike ride and dinner.  The weather was just great, mostly clear and sunny and high of 75 degrees.  We couldn't have asked for a better weather for a bike ride.

We started at the New River Trail Gambetta Access and headed North.  We followed the trail for about 2.5 miles, crossed over the New River to the Fries Junction, where we turned left and headed up the New River.  We rode on for about 3.5 miles till we reached the New River Outdoor Adventures on Fries Rd.  We then turned around and followed the trail back to our starting place, Gambetta Access.  We only had one accident (riding with no hands on the handle bars) and there were no bears, deer, raccoons or other exciting wildlife.  The kids had fun, it was a great time to be together with friends and enjoy the outdoors.

Of course, no get together is complete with out a meal.  We enjoyed hamburgers, hot
dogs, and grilled chicken and topped it all off with some Chocolate Lasagna dessert.


    

    

    

    

     


    


    



View more pictures and video in this Google Photos Album.