Watch a Sea Turtle on the Windows Phone

Chris Rajczi and Michael Perry worked very hard on the Sea Turtle application for the last few Dallas XAML User Group meetings. The application can be reviewed on the Marketplace at http://windowsphone.com/s?appid=c1ccc254-5735-471e-96c0-88a0d89d3a80.

So if you are reading this…please do two things:

  1. Download the free Sea Turtle Conservancy application by searching for 'Sea Turtle App'.
  2. Rate and Review the application.

The application code can be found on the Dallas XAML User Group past meetings section.  You can also review the past few newsletters on the Dallas XAML User Group site to see more details.

Thanks,
-Vince

Posted by vblasberg with no comments

I Have a Blog!!!!

Sure I have a blog, but all of my time is spent working on cool work or contributing to the Dallas XAML User Group.  I write the newsletters and maintain everything including the momentum, hopefully.

Feel free to drop by the Dallas XAML User Group on our monthly meetings, surf to the site and watch one of our videos, or read a newsletter if you have time.  There is also a nice list of webcast and podcast resources.

So there...  Guilt subsided for not contributing to the blog much.

-Vince
Dallas XAML User Group
http://www.DallasXAML.com

Posted by vblasberg with no comments

A Technical Packrat

My name is Vince and I'm a technical packrat.  ( Hello Vince.... )

I have notes from the first Dallas .Net User Group meeting in 2001 and the first Microsoft MSDN meetings in Dallas around 1998.  I have an ascii chart in my wallet but soon to be on my phone.  I have books related to project management in the late 80's.  I still have 8086 assembly and SQL 6.5 books.

    Why?  I'm a technical packrat.

After 20 years of development, I actually know who I am and what I want to focus on.  Technology moves like a train around mountains, but it still moves forward.  Some good advise I've heard is that if we don't read it in 3 months, throw it out.  It feels good to throw away obsolete things that no one needs.  A trip to the local Goodwill will be a relief.

What's in your wallet?

-Vince

Posted by vblasberg with no comments
Filed under:

Windows Phone Mango Release - Finally Upgraded

After several attempts, I finally got my Windows Phone 7 updated to the Mango release.  It kept failing and reported an error C1010007.  That error indicates that the cable is bad or not the original cable.  I finally tried again and kept touching the phone every minute or two.  The upgrade continued and finally finished.  I suspect the phone goes to sleep during the upgrade. 

Hope this helps others upgrade easier.  It's something to remember for the next upgrade.

-Vince

Posted by vblasberg with no comments
Filed under:

The .Net Micro Framework Event in Dallas

This is a mention of the event that came and went last weekend for the .Net Micro Framework here in Dallas at the Improving Enterprises offices.  Shawn Weisfeld worked on the event for the last 6 months.  Shawn pushed the moderately priced package from FEZ that proved to be an excellent product.  We all met last Saturday and went through some exercises to understand how to develop most of the basic tasks to interact with the plug and play hardware.  When the day was over, we all had a great understanding of how to create .Net application with Visual Studio 2010 and deploy to this device.  It's so much easier than the Windows CE deployments. 

All this to say that if anyone has a project that needs low-power consumption hardware integration, the FEZ boards are a great solution with C# and Visual Studio.  I think one of the coolest things on the board is not the ethernet, infrared, or color touch screen but the serial port integration.  There are still so many integrations needed for existing serial port devices.  Just plug this in and with .Net get you the rest of the way to a solid solution.

 The Products

Then there's an ebook with suggested projects for our cool new geek toy.  http://www.ghielectronics.com/downloads/FEZ/FEZ_Internet_of_Things_Book.pdf

Now I'm off off build something great with C# of course.

-Vince

Posted by vblasberg with no comments

Never SELECT * from Entity Framework called Stored Procedures

The Entity Framework can help us create an efficient Data Access Layer or a horribly inefficient one. 

It's worth mentioning that if we use Entity Framework to call a stored procedure that returns a database derived Entity using a SELECT * (star), we will have that horribly inefficient DAL.  Of course, as we've been told for years, SELECT * is 99.0% wrong with 1% for those dynamic field cases.  With EF calling a stored procedure, it's really wrong.

SQL Profiler will show us that the store procedure does return all records as fast as it can, barring a badly written stored procedure or low SQL server memory.  Entity Framework unfortunately does not assume all fields have returned.  EF then calls back with the defined primary key for each record.  This means that for a stored procedure that returns 1 million rows in one connection, actually returns 2 million rows with 2 million and one database server calls / connections from the application layer.  Try it on a 3 record table sometime to see that it calls SQL Server 4 times for three rows even when we use a stored procedure.  Enterprise DBA's will complain as they should.  If there is an obscure switch to avoid this, I couldn't find it.

The Moral of the Story:

  • Always define fields from the SELECT statement even if SQL 2005 and greater does optimize it for us.
  • Use SQL Profiler to look at the number of calls and the I/O count of each call.

-Vince

Posted by vblasberg with no comments

Containing Silverlight Lists and DataGrids in the Browser Window

In a typical Silverlight line-of-business application we have Lists, Grids, DataGrids, and StackPanels.  We populate a list and it flows down and off the browser page.  When we have a ScrollViewer, it will scroll the whole page including edit controls and graphics and not just the list that's tall and flowing off the page.  The good news is that we can easily contain the list in the viewable area with the few simple steps listed below.

  1. Remove the ScrollViewer from the page if it exists.
  2. Contain all upper area graphics and edit controls in a RowDefinitions of explicit size or Auto.
  3. Contain the lower List(s) in a final Grid RowDefinition with the Star notation to fill the remainder of the window using the outer-most Grid as a parent container.
  4. Optionally specify for the List properties,  VerticalAlignment="Top" and VerticalContentAlignment="Stretch".  Otherwise the List and its borders will stretch to the bottom of the screen even if it has no items.  Either way may be preferred. 

The following screen shots demonstrate this with a simple GridSplitter to size either side.  Notice the List on the left is using two rows compared to the list on the right.  The list on the right isn’t flowing to the bottom and uses only one row.  Both lists flow to the bottom of the browser window and no further, regardless of the number of items.

XAML rocks
.
-Vince


Runtime:

  

Designer:

  

 

XAML:

    <Grid x:Name="LayoutRoot"
          Background="#FFCEA1A1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <sdk:Label Content="List 1"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   FontSize="16"
                   FontWeight="Bold" />
        <sdk:Label Grid.Column="2"
                   Content="List 2"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   FontSize="16"
                   FontWeight="Bold" />
        <ListBox Grid.Row="1"
                 Grid.RowSpan="2"
                 Name="listBox1"
                 Margin="10" />
        <sdk:GridSplitter Grid.Row="1"
                          Grid.Column="1"
                          Width="10"
                          HorizontalAlignment="Stretch"
                          Grid.RowSpan="2" />
        <ListBox Grid.Row="2"
                 Grid.Column="2"
                 Name="listBox2"
                 Margin="10"
                 VerticalAlignment="Top"
                 VerticalContentAlignment="Stretch" />
        <sdk:Label Grid.Row="1"
                   Grid.Column="2"
                   Content="(Edit Controls)"
                   FontSize="16"
                   FontWeight="Bold"
                   HorizontalAlignment="Center" />
    </Grid>
</UserControl> 


Code-Behind:

private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    listBox1.Items.Clear();
    listBox2.Items.Clear();

    for (int i = 1; i <= 100; i++)
    {
        string listItem = "List Item " + i.ToString();

        listBox1.Items.Add(listItem);
        listBox2.Items.Add(listItem);
    }
}

 

 

Posted by vblasberg with no comments
Filed under: ,

Dallas GiveCamp 2011

Dallas GiveCamp came and went this last weekend.  It was my second GiveCamp and was very rewarding.  Our team created a site for the Tarrant County Birth Network.  Jon and I quickly explained the resulting web site and sat down, but I forgot to present and thank the team.  So this is a very weak attempt to thank them after the event.

Thanks to the Dallas GiveCamp team for a fun weekend.

  • Jonathan Keith - Developer
  • Nick Coombs - Developer
  • Rick Michaels – Developer
  • Sridhar – Very helpful floating developer
  • Shannon Blackwell - The very active charity representative
  • Jaime Grassi - Business Analyst
  • Vince Blasberg (myself) – Developer

The GiveCamp weekend was very unusual, thankfully.  There were many challenges from the first moment until the last.  In the end we at least accomplished one big thing.  We enabled the charity with a CMS that will grow as their needs grow.  They now have a huge network of .Net developers around the world that can easily develop and support them.  When they switch over to the new site, there is no doubt the requirements document will grow and there will be developers like our team to help them.

What is the Tarrant County Birth Network?
http://tcbirthnetwork.org/
The Tarrant County Birth Network is a community organization to provide information about, and advocacy for evidence-based, Mother-Friendly care for expectant Tarrant County families seeking a healthy, informed, and enjoyable pregnancy and birth.

What is GiveCamp
http://dallasgivecamp.org/
GiveCamp is a weekend-long event where software developers, designers, and database administrators donate their time to create custom software for non-profit organizations.

I hope to see everyone there next year.

-Vince

Posted by vblasberg with 1 comment(s)
Filed under:

Videos from My Past Presentations

Shawn Weisfeld has recorded several presentations that I've been fortunate enough to present at various times.  Shawn also stalks other active community speakers with that camera of his.  Check out the complete list on the INETA Champs live site at http://newlive.ineta.org/.  That's more than enough video content to fill a Saturday night or skip the Monday night football.


Here is a list of my presentations at http://newlive.ineta.org/Presentation/Speaker/26

 

Nuts and Bolts in XAML Part 1 - 7/6/2010
http://newlive.ineta.org/Presentation/ViewVideo/110


Nuts and Bolts in XAML Part 2 - 8/3/2010
http://newlive.ineta.org/Presentation/ViewVideo/122


Working with Data in Silverlight - 6/18/2010
http://newlive.ineta.org/Presentation/ViewVideo/106


Understanding Databinding with XAML in WPF and Silverlight - 3-2-2010
http://newlive.ineta.org/Presentation/ViewVideo/36
http://newlive.ineta.org/Presentation/ViewVideo/37
http://newlive.ineta.org/Presentation/ViewVideo/38

Posted by vblasberg with no comments

RIA Services - Solutions to 'The remote server returned an error: NotFound'

Isn't it great when the answers are out there?  I finally got a Google hint and overcame this one.  So here are a few reasons that I encountered and overcame this error.  We can easily reproduce (and often fix) this error.  This occurs on the asynchronous return from a Silverlight 4 to RIA services.  It's as if for any of the few reasons it fails, the call just gets aborted and we get a head-scratching "Not Found".  We can sometimes even hit a debugger breakpoint in the Domain Service that gets the IQueryable call and wonder why the server appears to work in the debugger.

Here are a few suggestions to help.

  1. Returning too much data for the object graph.  Solution: Edit the 'maxItemsInObjectGraph' setting in the web.config.
  2. Throwing an unhandled error on the service logic.  It can't get back to the client.  Solution: Comment out logic and see if the call succeeds.
  3. Solution: Only enable Anonymous authentication.  The request can then avoid authentication errors and possibly return successfully.  This one got me again tonight when deployed a new client’s project for the first time.  It also confused several of us at the Dallas Silverlight and WP7 DevCamp that I mentored at the other day.   The project will work great in the local development server but when deployed to IIS, we get a Not Found error.  So try disabling the Forms and Basic Authentication with only Anonymous enabled.  I'm convinced that this is the most likely reason for most people.

Hope this helps others with this unintuitive error message....Hopefully it's "Now Found".

-Vince

Posted by vblasberg with no comments
Filed under: ,
More Posts Next page »