Let’s say I’ve created two Visual Studio Projects with the same name “WebApp” but reside in different directories as shown below (c:\temp\Proj1 and c:\temp\Proj2).  I often call the project WebApp, however I want to keep the projects totally separate.  Below are the File/New Project dialog examples.

 

image

image

 

Now, when I click start (this is with the vs2011 preview I’m demonstrating), I see the following:

 

image

 

I actually have to hover over each “WebApp.sln” to tell which project is which.  I think that information should be in the pinned app itself, not require a hover over to tell which project it is.

Agree?  Add your comment below and go to the following link to vote up my connect suggestion.

https://connect.microsoft.com/VisualStudio/feedback/details/679081/should-have-vs-launch-shortcuts-inside-vs-recent-projects-because-run-as-admin

From the comments, Microsoft said they would consider it for the next release, but it looks like it has not made it.  Let’s try and change that!

 

OK, I think this is the longest post title I’ve ever made, but if you understand it, you’ll know why it needs to be so long.  I discovered this totally by accident.  I would never ever have pressed F11 (step into) from a client side proxy and expect to get into anything but a bunch of ugly machine generated proxy code (especially with Azure).  To my total surprise, I landed right inside my WCF service as if I had started the Windows Azure Developer fabric in debug mode and set a break point.

So, I’ll step through the process an show screen shots on the outside chance I was dreaming and can’t reproduce it. If I can, now I will have proof so I can do it again.  Sorry for the work in progress code you will see.  The point here is really the debugger and not the code I’m showing so try and ignore that.

OK, here we go.

Let’s assume you have a completely configured azure web role that is hosting a simple WCF service.  When you start that web role and point at the service, you’ll get something like this: (just a note that I started the app fabric by deploying directly from Microsoft Visual Studio 2010 with the start/run.  I am using a debug profile but am NOT running in debug mode.  If I do run the app fabric in debug mode, this does not work.

 

image

(more…)

For the last few days, I’ve been using DevExpress CodeRush and am finding some very useful refactorings.  Many I’m not blogging about, but there are a few that I really like.  In this post, I’m going to show just two of those refactorings that have been making my code much nicer and easier to write.  One is the “Introduce Using” refactoring, and the other is “Convert to Lambda Expression”.

Before I go into the details, I’d just like to disclose that when I was first writing the Silicon Valley Code Camp web site, I was an asp.net and c# newby.  I’m not claiming wizard status now, but I have to admit that when I go back and look at some of the code I wrote back then (including what I’m showing below before the refactoring), it’s a little embarrassing.  Silicon Valley Code Camp for me as “when I’m not doing real work” web site so I don’t really have the time to go back and clean things up.  Now, with CodeRush, it’s easy to clean things up when I see them with very little effort.

(more…)

I’ve recently started using CodeRush with Visual Studio 2010 and am so far very impressed with the convenience it adds to coding.  One thing that is very clear is that the creators of CodeRush are real programmers and look very hard for patterns that us developers are constantly doing.  As I run into these things that get my attention, I plan on blogging them.  Some are just earth shattering, and others, just nice to have.  This particular one is a nice to have.

So, say you have code like this:

 

var sessionAttendeeOds = 
new SessionAttendeeODS();
listSessionAttendees =
sessionAttendeeOds.GetByUsername(Context.User.Identity.Name);
 
(more…)

MSDN has a very nice article on how to create a windows service that hosts a Windows Communication Foundation (WCF) service.  It explains all the details of doing this in a step by step fashion.  One thing that I often find missing from these articles is the actual Visual Studio project that I can download and play with.  What I usually do is put that together myself (which I’m sure is the author’s intent).

To save anyone some time who wants to do the same thing, I’ve created a VS2010 project from the example, added a very simple Windows C# console application that consumes the service, as well as made some small changes in a very nice Windows Presentation Foundation (WPF) calculator project so that the calculator does it operations inside the windows service rather than in the calculator itself.

In this article, I’ve attached the source code (with my small changes and additions) for you to work with and change as you like.

(more…)
  Title Of Each Article Video Included With Each Post
Part 1 Introduction To RIA Services In Silverlight (This Article) 7 Minutes
Part 2 Basic RIA Services And DataGrid With  VS 2010 Tooling 14 Minutes
Part 3 Adding A DataGrid With Connect The Dots DataBinding in VS 2010 13 Minutes
Part 4 Adding a Navigation Page to a Silverlight Business Application Template 11 Minutes
Part 5 Adding Speakers Page Template With Converters In Visual Studio 2010 Beta2 11 Minutes
Part 6 Adding A Sessions Page That Includes a Query Parameter In Silverlight VS2010 Beta2 10 Minutes
Part 7 Basic Authentication and Authorization In RIA Services 5 Minutes

 

Get the Flash Player to see the wordTube Media Player.

 

This article will follow the previous article and go through the process of adding Converter’s for changing both the Id column and the Image column.  Basically, what we saw in the previous article was a DataGrid that was created and looked as follows.  (notice the Id column and the PKID columns which are highlighted.  Then, we will add a a DisplayItemTemplate that will format the page and make it look good.

(more…)
  Title Of Each Article Video Included With Each Post
Part 1 Introduction To RIA Services In Silverlight (This Article) 7 Minutes
Part 2 Basic RIA Services And DataGrid With  VS 2010 Tooling 14 Minutes
Part 3 Adding A DataGrid With Connect The Dots DataBinding in VS 2010 13 Minutes
Part 4 Adding a Navigation Page to a Silverlight Business Application Template 11 Minutes
Part 5 Adding Speakers Page Template With Converters In Visual Studio 2010 Beta2 11 Minutes
Part 6 Adding A Sessions Page That Includes a Query Parameter In Silverlight VS2010 Beta2 10 Minutes
Part 7 Basic Authentication and Authorization In RIA Services 5 Minutes

Get the Flash Player to see the wordTube Media Player.

Well, if you have gotten this far in the series, you’ve probably realized I’ve gotten my articles and video’s a little out of sync.  The video attached here goes through the full process of building an application from scratch while adding a navigation page.  The process was somewhat explained in the previous article.  I’ve kept the title the same because that is what the video actually shows.

(more…)

 

For the past couple years, I’ve used a product called FinalBuilder from VSoft Technologies to automate my build processes.  Since I’ve been building web sites (about the past 5 years or so), one of the biggest hassles is maintaining them.  That is, updating the databases, deploying the web site, automating backups, etc.  I’ve used several products like FinalBuilder (including Cruise Control), and to be honest, none of them come close to the quality of FinalBuilder.

Basically, the way the product works is that you create a “project” file using the FinalBuilder IDE.  That project file has “Actions” in it which do things like “ftp” files to servers, rename files, iterate over sql scripts, parse and update files, checkout from source control, as well as hundreds of other convenient functions.  You then execute that “script” file and all the magic happens.

image

(more…)

 

Not sure how many times I’ve pressed the “Show All Files” menu choice on a Visual Studio 2008 Project and nothing happens.  Well, I think I have finally found the pattern.

My guess is that you actually have to be clicked on the solution itself for the Show All Files to work.  I think I’m usually on a directory inside the project and it doesn’t work. That is, I may be inside the /bin directory and expect that if I click “Show All Files” that I will see all the files in the bin directory (like the .config files).

(more…)

Not sure why this was hard, but I wanted to make a trivial command file to deploy my database (or any change to it).  For those of you that don’t know the DataDude project, I have to say it’s one of the coolest tools that has come out the Microsoft Visual Studio Team for a while.  Basically, in a nutshell, what it does is split’s your database into hundreds of little files.  One for each table, key, foreign key, user, role, etc.  Then, since it is a standard VS2008 project, you can keep those files and the project under source control.  The big benefit is that multiple team members can change files and check them in, and everyone’s schema is kept up to date.

(more…)

Several years ago, I was invited to a special showing of what was going to be the new SqlServer 2008 database in San Francisco.  I had expected a sales demo but was hugely surprised by the quality of the presenter and his deep understanding of issues facing real developers like us.  Over the years, I’ve gotten to know this presenter (Richard Hundhausen) and the other work he’s been involved in.

(more…)

I’ve done a bunch of Lat/Long type mapping programs over the years and one of the problems always ends up around performance.  A common problem is that you keep redrawing the same line over and over and over.  The pixels you are drawing don’t get any darker so all you are doing is wasting time.  In my current project, we were drawing approximately 1500 lines when we really only had about 150 unique lines.  I’ve always known how to solve this problem with a bunch of thrown together hacked up code, but now, LINQ gives me a very clean way to do it.

So, the problem is you have a record that looks like this:

 public class LoadSegmentInfoFlat
        {
            public double? OriginLattitude { get; set; }
            public double? OriginLongitude { get; set; }
            public double? DestinationLattitude { get; set; }
            public double? DestinationLongitude { get; set; }
            public string Color { get; set; }
        }
(more…)

So, this is kind of embarrassing, that it took me a while to figure this out.  I have not been doing pure asp.net server control programming for a while, but I figure since it took me a while, maybe there is someone else in the same boat.

So, you have a GridView or DetailsView that has standard “Edit” “Update” “New” type command buttons on them.  The way they get there is by having the declaration something like this:

(more…)

 

William Bartholomew just published a new book on MSBuild and TFS. There is a great forward by Richard Hundhausen (Famous TFS Author and top MS consultant).  I personally don’t use TFS yet, but I do use MSBuild and plan on using it more extensively for web deployments going forward.  I have not yet read the book, but am anxiously looking forward to.  It is a topic that IMHO has been very under documented.  This should be a big help!

As a developer who has spent much of my life doing DBA type work, I really appreciate the simplicity and elegance of what Microsoft Visual Studio Team has put together with the Database Edition and can be seen for sale here as the Microsoft Visual Studio 2010 Premium with MSDN Download – Download Direct from Microsoft I’ll first try and explain in a nutshell what it is.  Then I’ll go through an example of creating a Visual Studio Database Project out of a site I’ve been working on to show the steps.  Finally, I’ll give a short summary reliving the experience and giving you some other pointers that may help you get through the experience.

What is VS2008 Database Edition?

Basically, what VS2008 does is to first process your existing schema into hundreds (maybe thousands) of little files.  That is, each file is one database thing. That thing might be a table definition, a stored procedure, a trigger, a constraint, a foreign key, etc.  The beauty of this is that now, each thing can be tracked separately.  Say for example, you want to update just one table and someone else on your team wants to update another table in the same schema.  Since the files are now separate files, it’s no problem.  When you grab the latest changes from source control, you will get your friends changes and he will get yours.  Very very clean!

Also, it has a very powerful comparison engine.  Say you update your data outside of this project.  VS2008 Database Edition will compare your definitions in all these little files with either a sql script you generate, or it will connect to an external database and compare to that.  Me personally, I like to use a tool called SqlManager to manage my data.  I can continue to do that, then when I’ve made my changes, I can simply connect VS2008 Database Edition to my updated development database and it will automatically figure out the changes.

So, you may ask, what version do I need to run this of Visual Studio?  The answer is in this link:  http://msdn.microsoft.com/en-us/vs2008/products/cc149003.aspx

Here We Go, Let’s do an Example

So, first, I will open my existing solution which has a web project in it, a data access project as well as other projects.  Then, I create the new Database solution by saying File/Open/New Project/Database Project.

image

Then, we follow the wizard…

image

Taking defaults…

image

image

Now, I choose my schema.

image

Press Start…

image

Once you’ve done that, you’ll now have your schema spread out across your project in little files.  Below is what the "file based" view of your schema looks like.

image

Notice that the file we are looking at also includes comments for both the table and the columns using the standard extended property documentation format as follows:

GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', 
@value = N'tracks all changes from each camp

title;link;guid;pubDate;category;description', @level0type = N'SCHEMA', 
@level0name = N'dbo', @level1type = N'TABLE', 
@level1name = N'CampFeed';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', 
@value = N'if true, this is the main news feed from the site.  
there should only be one main news feed from any site.  this would 
not be feeds like twitter', @level0type = N'SCHEMA', 
@level0name = N'dbo', 
@level1type = N'TABLE', @level1name = N'CampFeed', 
@level2type = N'COLUMN', @level2name = N'PrimaryFeed';
 
Now, when you actually build the project as follows:
image 

it will generate the full script combining all the files back into one again. Here is where it puts it:

 
image 
 

So, that’s about it for now. I haven’t gone into any of the ways to compare and update your schema based on external changes, but we can leave that for another post.

To see a great video by Richard Hundhausen, President of Accentient, a Team Systems Consulting company, go to this link:  http://msdn.microsoft.com/en-us/vsts2008/cc659682.aspx

Also, if you are using Sql Server 2008, make sure you install visual studio 2008 sp1, then go to this link and install the download:  http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed&displaylang=en

Conclusions

From what I can tell, this Visual Studio Database Edition will be a huge help in building database schema’s and database programs (sp’s, triggers,etc.) in a collaborative environment.   If you have the license to use this, I strongly recommend it.  It is definitely going to be part of my tool kit for now on.  Even if I’m the only author in the project.

So, you want to do an update but are wondering what the hec LINQ is doing.  Turns out it is really easy.  All you have to do is run in the debugger and add the Log option to your data context.

Here is an example:

DataClassesGeneralDataContext db3pLogicContext;
db3pLogicContext.Log = Console.Out;
 
var companyQuery = from tbl in db3pLogicContext.Companies
                   where tbl.ParentId != 0
                   select tbl;
 
int totalCntParents = companyQuery.Count();
foreach (DBAccess.Company co in companyQuery)
{
    co.CreateDate = DateTime.Now;
    break;
}
 
db3pLogicContext.SubmitChanges();
 
(more…)

http://www.linqpad.net/ – Use with Microsoft .Net for building Query type expressions with LINQ

I’m not a wizard at writing LINQ expressions so I often find myself in Google looking for something similar to what I want, then I put it into my application and run it. This has worked pretty well, but it takes a couple iterations to get it right. It occured to me that someone probably has written a LINQ interpreter so I just guessed the name, LINQPad, typed it into search, and I find the authors of the book C# 3.0 in a nutshell, Joseph Albahari and Ben Albahari, (which I like a lot) have written it.

(more…)

Seems, I keep forgetting where the temporary files asp.net uses. The reason it’s nice to know is sometimes you may want to open them with Reflector to see the generated code.  Also, sometimes, you want to delete those files because asp.net is confused and is reusing old ones.  So, here is the magic lines of code you need.

(more…)

This past Wednesday, June 25th 2008, I did a presentation titled “Building High Performance ASP.NET Web Applications” to the Bay Area Association of Database Developers (BAADD).  Through out the presentation, I showed an application in Visual Studio 2008.  I’m including that project file here as well as the power point slides used in the demonstration.

Download Solution – HeuristicCache.zip

And the Power Point Presentation:

Any Questions, feel free to contact me at http://peterkellner.net/contact/

Article Series

(Source Code Available in Article 6 Below – (Added March 2009))

Article 1: Best Practices for Building an ASP.NET quality web site
Article 2: Multi Level ASP.NET Menu with CSS Friendly Control Adapters
Article 3: Creating a Theme For Each Year of Code Camp Using Skins in ASP.NET
Article 4: Creating a Modal Login Window Using the Telerik Modal RadWindow Component
Article 5: Using LINQ to Merge Mailing Lists and Filter Opt Outs
Article 6: Multi Level ASP.NET Menu with CSS Friendly Control Adapters (The Source Code!)

Introduction

If you have complex styling issues involving ASP.NET we are experts and might be able to help. This technique is fairly old however newer methods could be used for similar results. Contact Peter Kellner and his associates here.

It’s often the case that brilliant designers will make interfaces that are hard to implement using standard frameworks like ASP.NET.  As Software engineers striving for consistency, we always want to do the best we can with the standard tool kits to take advantage for built in functionality.  ASP.NET 2.0’s built in menu system is a perfect example.  If you use that menu system, you get to make very simple declarative site maps by simply using the ASP.NET 2.0 Site Navigation Features.

The requirement faced today has to do with building the web site for our third annual code camp.  We have that brilliant designer I mentioned above, and he has made a design that just seems too perfect to compromise.  Here are some screen shots of how the designer envisions the sight looking and working after it is completed.

(more…)

© 2012 PeterKellner.net. All Rights Reserved