All posts in Visual Studio

Microsoft’s personal web starter kit, included in Visual Studio 2005, contains two small bugs.
Issue 1: In the photos administration page the ObjectDataSource used for the CRUD (CreateRemoveUpdateDelete) operations does not provide any parameter declarations for the update and delete functions. Thus when trying to update or delete a photo you get an exception saying that the method call requires a parameter that’s not provided.

<asp:ObjectDataSource ID=”ObjectDataSource1″ Runat=”server” TypeName=”PhotoManager” SelectMethod=”GetPhotos” InsertMethod=”AddPhoto” DeleteMethod=”RemovePhoto” UpdateMethod=”EditPhoto” >
  <
SelectParameters>
    <
asp:QueryStringParameter Name=”AlbumID” Type=”Int32″ QueryStringField=”AlbumID” />
  SelectParameters>
  <
InsertParameters>
    <
asp:QueryStringParameter Name=”AlbumID” Type=”Int32″ QueryStringField=”AlbumID” />
  InsertParameters>
asp:ObjectDataSource>

Issue 2: If you install the database backend by running the script provided (personal-add.sql) in the PWS folder (usefull when you’re usind a shared hosting service) the EditAlbum and EditPhoto stored procedures have different parameter names than the ones provided in the Photos.aspx administration page (original_AlbumId and original_PhotoId is needed) causing a parameter exception when trying to update either an album or a photo.
CREATE PROCEDURE EditAlbum
@Caption nvarchar(50),
@IsPublic bit,
@AlbumID int
AS …
CREATE PROCEDURE
EditPhoto
@Caption nvarchar(50),
@PhotoID int
AS …

I’m sure that the people behind the SK have already noticed the problem and published or going to publish a fix for it. I just thought that I should let everyone know since I’ve already stumbled on them.


It seems that the way visual studio understands the SQLExpress server name has changed or that security settings have disabled the .SQLExpress syntax (which obviously meant local computer SQLExpress instance) on Vista. So if you try to create a new database from the AddItem menu item of visual studio 2005 or connect to an existing one that uses the above syntax in the connection string you will most probably get an error saying that “failed to generate a user instance of sql server”.
What you’ll have to do (this took me a while to figure out, so you should thank me 🙂 ) is modify the server name/instance to the fully qualified one. If you want to create a new database you should first create it from the management studio, then add it to your project and modify the connection string.


Installing all the software I need in my new Operating System, I’ve stumbled across my first real problem, (had various other small ones, which didn’t worth mentioning) Source Control. VSS 2005 does not install on Vista. I get a software requirement error, stating that Windows XP SP2 is needed in order to complete the installation. So if someone plans on checking out code from office and work at home with it in his Vista enabled laptop, he better forget about it, or use another source control system L. I wonder if there is any work around I could use…
I’m curious what source control Microsoft’s engineers/developers use for their code if  VSS does not work with vista?


I’m a huge fan of software modeling, I guess my studies both as a Naval Architect and Software Engineer is to be blamed for this. Both disciplines require a lot of designing, modeling and planning in order to build a good product.
So I was very happy when I found out that visual studio included a Class Diagram designer (it’s not a UML tool but it’s a start), and especially one that allows real-time synchronization with the code.
Although I’m a huge fun of this new feature, I find the fact that I cannot set the accessibility of a property (by default a property when created, creates both get and set accessors and there is no obvious way of deleting just one of them) from the designer extremely frustrating.
Hope that the next Visual Studio patch will fix this…