Sharepoint in plain english

In search of finding a way to explain to a customer who knows nothing of sharepoint, what it is, I found this video on youtube.

 

It is actually a really good video, that explains the basics about sharepoint.

Error: Could not get a list of SSIS packages from the project.

When I was working with a SSIS project at a customer, I got the following error.

Error: Could not get a list of SSIS packages from the project.

I had CreateDeploymentUtility=true.

That error description apparently indicate, that there is an error in the dtproj file.

The solution: Set CreateDeploymentUtility=false, and then build the project again. The you will get a specific error telling you what is wrong in the  dtproj file. Correct the error, and enable CreateDeploymentUtility again.

Start SQL server from the command line

SQL server can be started and stoped from the command line like this:

Start: net start mssqlserver

Stop: net stop mssqlserver

The same goes for Analysis Services.

Start: net start “SQL Server Analysis Services (MSSQLSERVER)”

Stop: net Stop “SQL Server Analysis Services (MSSQLSERVER)”

Code blocks are not allowed in this file - running asp.net pages with inline code in sharepoint

If you upload a standard asp.net page with inline code to a document library on your sharepoint installation, you will properly get the above error message.

To avoid it, do the following:

Open the sitecollections web.config placed somewhere around here:

C:\Inetpub\wwwroot\wss\VirtualDirectories\XXX.

Go to the tags

<PageParserPaths>
</
PageParserPaths>

And put this in between.

 

<PageParserPath VirtualPath=/*

CompilationMode=Always

AllowServerSideScript=true

IncludeSubFolders=true/>

 

It is now possible to run asp.net code from all your document libraries. For many obvious reasons, this is a really bad idea :-) But it can come in handy on your development machine.

If you just want to allow it for a single page(For instance a master page), change virtual path to point directly to that page.

New web page

I just created a new web page.

The site is in Danish, and it is a running site, where you can see statistics about yourself and compare yourself to other runners. You can see the site here:

www.perfmon.dk or here:  www.performancemonitor.dk 

Since the site is in danish, and don’t cover anything technical, it don’t really fit anything on this web page.

It is however a product of a bundle of MS technologies, such as ASP.NET, LINQ, MS Live maps and reporting services. I think that justify a link :-)

Reporting services – Slow first hit

After reporting services have been idle for a time, the next hit on it can be extremely slow. This is, as with every other RS problem, an IIS thing.

The problem is that when the IIS is not getting any traffic, it “goes to sleep”, to clear up memory for other applications.

That is nice, in the case where you are using the server for something else, and when you are only hosting standard ASP.NET pages, that can start up relatively fast. 

It is not so nice when you are using the server for reporting with reporting services. Then the first hit can take up to minutes. 

There are some solutions to it, depending of your version of IIS and SQL server.

IIS 6.0 and above and reporting services 2005:

  • Open IIS manager
  • Under application pools right click DefaultAppPool and select properties.
  • Under the performance tag, you can change the value for the idle timeout. Default is 20 minutes. If you change it to 480(60*8)(A working day), only the first hit of the day will be slow.
  • You can solve this problem by creating a dummy report each morning before everyone meets(See below)

IIS 5.1 and reporting services 2005

IIS 5.1 doesn’t come with an application pool, so here you have to change the idle timeout a different place.
The idle timeout for the IIS is placed in the machine.config file.
The machine.config is located somewhere around here:

%windir%\Microsoft.Net\Framework\v2.XXX\config\machine.config

Change the tag

<processModel autoConfig=”true”/>

to

<processModel idleTimeout=”08:00:00″ autoConfig=”true”/>

That should solve the problem, but you should still have the problem with the first report of the day, so you still have to schedule a dummy report.

Reporting services 2008

So what about reporting services 2008, where you don’t even need the IIS?
I don’t know, but I hope and guess, that is something simple. Please let me know if you know the answer :-)

Creating a dummy report
There are two ways to create a dummy report.

The right way, is to schedule a report, and copy it to a file share or have it mailed to you.

If you don’t have those possibilities for some reason. You can create a report, that refreshes itself every hour or so. That way, the report server won’t fall asleep either.

Derived column IF expression

I can never remember the SSIS if syntax in the derived column control, so Just so I can remember it myself :-)

The syntax is like this:

(compare) ? true : false 

So if x equals  5 and y equals 1, then this will return x

(x>y)?x:y

region->kommune->postby

In my daily work I often have to link something to a location in Denmark, and typically in the form of Region->Kommune->Postby.

Every time I start on a new project, I always find myself goggling for a file or something I can use for that, and Always without success.

So I decided to create one myself, so I have one. You can download it here: RegionInfo.

Please leave a comment if you are using the file, or if you want it in a different format.

Something for my wish list :-)

I would be cool if there was a web service(or a file you could download) where this information was available for the whole world. Not in the form of the Danish Region->Kommune->Postby, but in the form that would make sense for the different countries. Something like this maybe:

  • Country- Region->Kommune->Postby
  • Country-State-City
  • Etc etc. 

Ofcourse there had to be some metadata attached to it, which specified what the name of the level is for the different countries.

A super cool feature could also be, if all these data  came with a set of longitude and Latitude coordinates, that specified the location on a world map, hence a lot of application today creates data based on a point in a GPS or in an GIS application (maybe with Google or MS maps) .

Well, that is just something that could be extremely useful for me. If you know of any such web service, or anything related, please drop a comment or an e-mail :-)

Try Catch in VBA

I’ve done a little VBA (Visual basic for applications) programming lately, and today I ran into a problem, where I wanted to make a simple try catch.

The error occurred because the users put letters instead of numbers into a specified field, so I just wanted to do some simple user validation with try catch.

Apparently, there is no such thing as try catch in VBA.

Instead of try, you have to use the”on error” statement. So a Try Catch will look something like this.

”…some code…
On Error GoTo ErrHandler:
”…The code, where you might get a run time error

ErrHandler:
    ” Some error handling code
Resume Next

When an error occurs, the code will jump to the ErrHandler label, and the resume next statement will continue to run the rest of the code.

I guss that is nice to know :-)

Setup the Membership and Roles features in ASP.NET

There are a lot of tutorials about how to use the standard membership and role features, and the custom controls that comes with them in ASP.NET.

There is however, a lack of information about how you setup and config your database and your web app, so you can use it with your standard MSSQL server.

First you need to run the ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe), and point it to the database you are using. It is located here: C:\\%windir%\\Microsoft.NET\\Framework\\<versionNumber>\\aspnet_regsql.exe

Aspnet_regsql creates the tables and stored procedures, that your web app needs for you to use the standard controls.

Next you have to tell your web app where it can find the database with your membership information. You do that by adding these lines to the webconfig:

< connectionStrings>
<
remove name=LocalSqlServer/>
<
add name=LocalSqlServer connectionString=Server=servername;UID=your userid;PWD=your password;initial catalog=your catalog/>
…(add your other connection strings here)…
</connectionStrings>

You are now ready to start using the standard ASP.NET membership and role custom controls.
You can start here: http://www.asp.net/learn/videos/video-45.aspx