LINQ Demo from Heroes Community Launch

Sorry for the lack of post lately.  My family just finished moving into a new house and my life has been a whirlwind.  Hopefully, we are on the downside and I can start focusing on Technology related stuff again.  Honestly, hanging curtain rods is not my idea of a great weekend...

Anyway, I wanted to drop the demo code, DB script and slides out here so people can take a look.  I had a great time doing the presentation with Eric Johnson.  Even though Eric is a DBA he is still a good guy.  Who knew that some DBAs actually have a soul?  Seriously though, I've been hanging out with the Springs SQL Server User Group for awhile now and they are a great resource when I come across SQL related issues.  Check them out if you haven't already.

Here is the Zip of all the materials from my session:

LINQHeroesLaunch.Zip

Posted in Labels: , | 0 comments

TFS Error - Command "exited with code 1" during build

We recently made some modification to our Team Foundation build server.  Ever since then my automated builds started getting this random error.

error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe" workfold /map /workspace:"CTCTFSBUILD1_23" /server:http://servername:8080/ "$/myproject/Current2008/LumenWorks.Framework.IO" "c:\builddir\myproject\IB - Workflow\BuildType\..\Sources\myproject\Current2008\LumenWorks.Framework.IO"" exited with code 1.

It was a weird error because usually if I just started the build again it would complete successfully the next time.  It finally got annoying enough that I did some research and solved the problem.  It was a timeout issue.  So, if there was a heavy load on the build server my build would fail.  Here is the command that was causing the issue.

<Exec WorkingDirectory="$(SolutionRoot)" Command="&quot;$(TfCommand)&quot; workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:$(TeamFoundationServerUrl) &quot;%(Map.Identity)&quot; &quot;%(Map.LocalPath)&quot;" />

Turns out there is "Timeout" property you can set.  I think the default is 30 seconds, but I upped it to 2 minutes just to make sure I didn't timeout due to server load.  Here is the command after I fixed it.

<Exec Timeout="120000" WorkingDirectory="$(SolutionRoot)" Command="&quot;$(TfCommand)&quot; workfold /map /workspace:&quot;$(WorkSpaceName)&quot; /server:$(TeamFoundationServerUrl) &quot;%(Map.Identity)&quot; &quot;%(Map.LocalPath)&quot;" />

I'm not sure how many people are running into this issue, but it was hard to track down so I posted it here and hopefully it will save some other people some time.

Posted in | 8 comments

CS Techcasts - SQL Server and LINQ Webcast\Podcast

Last Thursday at PASS Camp in Denver I participated in a live webcast\podcast related to SQL Server topics.  Why was a developer involved?  Well I don't want to spoil the surprise so you'll just have to watch.  Wether your a SQL Server expert or just know enough to be dangerous this is a great informational cast.  Check it out!

http://www.cstechcast.com/home.aspx?Episode=15

LINQ to SQL is the Devil?

Last Thursday I attend the SQL Server Pass Camp in Denver.  As one of the only developers there I got a lot of negative vibes related to LINQ to SQL and ADO .Net Entity Framework.  DBAs seem to think any tool that generates SQL statements is evil.  I have to admit I agree with them.  Even if the generated SQL is flawless, it can take away the DBAs ability to tune performance.

However, I think there is a happy medium that will help DBAs sleep at night and still give the developers the flexibility they need.  It's the same answer we've been using for years, Stored Procedures.  If you think about it, developers have had the option of running SQL queries directly against the DB for years using inline SQL statements.  So, nothing has really changed.  LINQ to SQL and the Entity Framework both have full support for stored procedures.  Use Stored Procedures for all updates, inserts and deletes.  You can also use stored procedures to retrieve data. However this takes away some of the the flexibility LINQ to SQL and the Entity Framework provide to the developer.  So, for reads I recommend using views.  They allow DBAs to restrict the columns visible and also provide an extra layer of security.

All the feed back I received from DBAs was positive once I explained that stored procedures and views are still the best practices for these new technologies.  They were also put to ease when I reminded them that this really is nothing new for them.

So to answer the question, LINQ to SQL is not evil.

Fallout From The Colorado PASS Camp

Yesterday I attended and presented at the Colorado SQL Server PASS camp.  A developer at a SQL DBA event?  And he made it out alive?  Yep I feel like I cheated death.

No seriously, I had a great time and learned many things about some of the DBA's fear of LINQ and the ADO.Net Entity Framework.  I will post more about this subject in a separate post in the interest of not making my posts too long.

Look for a series of posts regarding the info I gathered from attending this event.  Thanks to everyone who organized and attended the event!

Posted in Labels: , | 0 comments

SQL Server - Colorado Pass Camp this Wednesday and Thursday

I apologize for the late notice on this but tomorrow and Thursday is the Colorado Pass Camp in Denver.  It is a free event related mostly to SQL Server related topics.  You can get all the info and register here.

I’m mostly a developer, but I find it makes me a better developer if I understand SQL Server and the issues most DBAs deal with on a daily basis. 

In this age of technology no one can know everything about everything.  However, understanding the theory and reasoning behind many different things can help you do a better job of developing good applications.  I might not always know the details of how to do certain things in technology, but I can always learn and find the details online when needed.  So, simply knowing the strong point for using one technology over another is enough to make a decision and then go learn the details after the decision is made.

I am actually a part of PASS on Thursday.  I’m participating in a pod\screen cast in the morning and then presenting on LINQ and .Net in the CLR later in the day.

Please come up to me and say Hi if you are attending!  See you there.

Posted in | 0 comments

To Invoke or not to Invoke? That is the Question!

Yesterday I was having a problem with my UI on my smart client application.  I’m using the offline data block from the MS Patterns and Practices group.  It took awhile to learn how to use this, but now that I am I really like it.  It uses a separate thread to do the data requests.  Well, as most applications would I wanted that thread to update a progress bar on my UI to tell the user how many requests where in the queue and when they where completed.

This sounds like it should be easy, but hopefully most of you know that a separate thread cannot update a UI element on the main GUI thread.  This article talks about why and how to do it using the Invoke() method.  I was using the Invoke() method and everything was running fine at first.  However, after I started testing the application started to deadlock\freeze.  I put lock statements all around my code to try and avoid the problem to no avail.

Finally I ran across this post from Kristof Verbiest which explained my problem.  The Invoke() method IS NOT an asynchronous call.  The code will wait for the method called within the Invoke() to complete before it moves on.  So, what was happening was my main thread was waiting for the Invoke() and also calling the thread to do another request.  This caused the deadlock.  The post from Kristof explained that the BeginInvoke() method IS an asynchronous and will allow the code to continue.  By changing my Invoke() calls to BeginInvoke() I fixed my problem.  Thanks Kristof!

So the answer is to not Invoke(), but to BeginInvoke()…

Posted in | 2 comments

Application UI Design Mistakes

I came across this article in my daily web surfing.  I’d like to think I know all these rules, but they are good to keep in the back of your head and revisit when you start desigining UI for a new project.

Posted in | 0 comments

South Colorado Launch 2008

It’s official!  Friday, April 4th from 2:00 – 6:00 PM all three South Colorado User Groups (.Net, SQL Server and Windows Server) will be collaborating to bring you some great content related to the new releases of Microsoft technologies.  All the sessions are still being finalized and the official schedule should be up soon.  Keep your eye on the official site here for more details.

I’m sure there will be great content, but please plan on attending for no other reason than to connect with the Microsoft community here in the South Colorado area.  Learning from our peers is a fun way to think outside the box and come up with new ideas to solve everyday issues.  I hope to see you there.

If the weather cooperates you should just take the whole day off and get in 18 holes before attending.

Posted in | 0 comments

WCF 404 Page Not Found

Just a quick note about hosting your WCF service in IIS.  I had some problems getting this to work yesterday.  Everything worked great on my developement machine.  I had my WCF service serving up data and functionality to my ASP.Net front end and a Windows Service I’m using for automation and monitoring.  I moved everything out to IIS on the test machine, configured the sites in IIS and started testing.  I kept getting HTTP 404 Page Not Found Errors while trying to reach my WCF service.  I found a great blog post from Jean-Paul Smit that finally solved my issue.  I had to do number 3 in his list of possible solutions. 

%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe /s:W3SVC

Once I ran this from the cmd prompt everything worked great.  Thanks Jean-Paul!

One final note: If you don’t have the file mentioned above you need to download and install .Net Framework 3.0.  I ran accross this on one of my servers. 

Posted in | 12 comments

Serializing a Generic Dictionary

So, I created all this fantastic code (God, I love my work) that used a singleton to hold some data that I needed throughout my app.  One of the properties in that class was a generic dictionary.  Well, as I got further into the application I came across the need to persist this data to an XML file.  Naturally (almost instinctively, which means I have no life), I wrote the few lines of code to use the XMLSerlializer to save this to disk.  The problem is the generic dictionary is not serializable.  I was dreading the idea of changing the way I was storing and using that dictionary all through out my app.

To make a long story short, (too late) I did a search and found this post from Paul Welter’s blog.  All I needed to do was create this class in my project, change the data type on my dictionary in my Singleton and it all worked and serialized perfectly.  Thanks Paul!

Posted in | 0 comments

Salesforce.com Announces Development-as-a-Service

Many of the ‘line of business’ applications today are starting to expose their core framework as a development platform.  MS CRM is a great example of this.  It’s a great CRM solution, but it can also be extended and used to solve countless other line of business needs.  For more information on MS CRM check out David Yack’s CRM blog or the MS CRM site.

Salesforce.com is jumping on this bandwagon but is also adding an interesting twist.  They are selling their development framework as a service.  It’s also interesting that they are introducing a $0.99 per login option.  You can find some details about this announcement here and get more information on the Salesforce site.  MS CRM has a similar option called MS CRM Live that includes a subset of the extensibility features and is hosted by Microsoft.  You can read more about MS CRM deployment options here.

Looks like these two products are going to battle it out in this space.

Posted in | 0 comments

LINQ Visualizer

Scott Guthrie does a great job of describing how to get and install this here.  Take the 5 minutes to do it.  It’s worth it.

Posted in | 3 comments

LINQ Talk - Colorado Springs SQL Server User Group

I just got the opportunity to do a talk on LINQ at the Colorado Springs SQL Server User Group tomorrow night January 16th.  The meeting starts at 5:30.  I’m going to add some content that is more SQL Server related and try to inform everyone what LINQ means to the SQL DBA community.

For more info please vist the Colorado Springs SQL Server User Group site.

Hope to see you there.

Posted in | 0 comments

Accessing the ApplicationSettings section of the App.config with C#

OK, this sounds like a no brainer, but I ran into an issue the other day and it took me forever to find the information needed.  I used the GUI in VS 2008 to create some strongly typed application settings.  This is easy to do.  Right click on the project and select Properties.

AppSet1

I created two settings: one is a DateTime and the other is a bool.  This is the easy part.  The hard part is getting and saving these settings in code.  Well, it’s not hard once you know what you are looking for.  I searched far and wide using ‘Application Settings’ and C#.  I found all kinds of document ion about the Mysettings namespace in VB.Net but nothing on C#.  I even scoured the documentation from MSDN.  I finally found an answer on a forum somewhere.  You use the ‘Properties.Settings.Default’ namespace.  So, I can access my settings using this code.

AppSet2

If nothing else just remember this post for future reference in case you run across this yourself.  For some reason the ‘Properties’ namespace just isn’t intuitive to me.  There is also a lot of confusion out there revolving around the difference between ‘Properties.Settings.Default’ and the ‘System.Configuration.AppSettingsSection’ namespaces. One of the reason I’m blogging on it is so I can reference it the next time I run into this.

Posted in | 18 comments

Microsoft's Enterprise Library

I recently received a questions regarding the best practices for doing data access.  My company has our own internal data access architecture and code generator that works great.  However, if you are starting a new project and don’t have an established architecture, I would take a serious look at Microsoft’s Enterprise Library as a starting point.  It contains many best practices regarding data access, logging, exception handling and more.  What’s better is you get the source code so you can tweak it as needed.  

There is also some great and affordable training on Enterprise Library available from Innerworkings.  I’ve blogged about Innerworkings before (here).  They have mastered e-learning.  Just go to the catalog on their site and you can find the Enterprise Library training in either VB.Net or C#.  I think the two part series will run you about $60.  Not a bad way to get a quick start in this stuff.

Posted in | 3 comments

JavaScript Performance

I subscribe to the Jeff Atwood’s Coding Horror blog and he posted this yesterday about JavaScript performance.  He also mentions that the browser market is getting more and more competitive so if you have a public facing web application make sure it looks good on all the latest browsers.  Sometimes us ASP.Net coders forget there are other browsers out there  

 

Posted in | 0 comments

ASP.Net 3.5 Extensions and ASP.Net Dynamic Data Support

I also installed the ASP.Net 3.5 Extensions yesterday.  I figured I might as well take the plunge on all this stuff.  I’m hoping to install and play with the ADO.Net Sync Framework sometime soon as well.  Anyway, the CTP for ASP.Net Extensions is an easy install.

The best source for information on this is Scott Guthrie’s blog.  If you don’t subscribe to his blog you should.  He post great stuff for developers of all skill levels.  Below are a couple of cool posts he’s done lately related to the Extensions CTP.

What’s Included in the ASP.Net 3.5 Extensions CTP

ASP.Net Dynamic Data Support

Posted in | 0 comments

Installing the Latest Version of the ADO.NET Entity Framework

Last night at the Installfest in Denver we got a quick look at the ADO.Net Entity Framework.  It looked interesting to me so I researched it a bit more today.  The overview here is a pretty good place to start.  I’d read through that first to get an idea of what we are trying to accomplish.  Then make sure you have Visual Studio 2008 installed and follow these steps to install the add-ons that allow you to start playing with the Entity Framework:

  1. Make sure you uninstall any previous versions of the ADO.Net Entity Framework.
  2. Install this hot fix for Visual studio 2008.  Honestly, I could not find much documentation on why this is needed.  For what it’s worth, I installed it and it didn’t break anything that I can see.
  3. Install the ADO.Net Entity Framework Beta 3.
  4. Install the ADO.Net Entity Framework Tools.
  5. Install the ADO.Net Entity Framework Samples.
  6. Check out this additional documentation.

If you were using the old version of the framework you might want ot check out this post about the breaking changes between Beta 2 and 3.

Other than that happy coding!  Please let me know how it goes and any cool things you find with this stuff.

Posted in | 0 comments

Visual Studio 2008 Installfest

Last night we had a great event in Denver.  It was called an ‘Installfest’ and included a free version of VS 2008, free drinks, great food, networking and great demos of the new features in VS 2008.

If you’d like to take a look at some of the stuff we discussed here is a link to Rob Bagby’s post with the info.

We also talked about many things that are not in these demos.  We spent some serious time on LINQ.  If you want to learn more about link you can get started by downloading my presentation and demos here.  Scott Guthrie’s blog also has a whole series on LINQ.

Finally, we touched on a couple of new things that look really cool.  The Entity Framework and the Sync Framework.  I did a bit more research on these two topics today.  I also installed all the extensions and add-ons to get these things working.  I will put the installation steps in a different post shortly so those folks looking just for the steps can find them.

Overall, it was a great event and I recommend going to an Installfest in your area.

Posted in | 0 comments