Sunday 26 May 2013

Web Application Projects versus Web Site Projects in Visual Studio

In Visual Studio you can create web application projects or web site projects. You create or open a web application project by choosing New Project or Open Project in the Visual Studio File menu. You create or open a web site project by choosing New Web Site or Open Web Site in the File menu.
Each type of project has advantages and disadvantages, and it is helpful to understand the differences between them in order to select the best project type for your needs. You must select the appropriate project type before you create a project, because it is not practical to convert from one project type to the other.

For some scenarios, you do not have a choice. For example, if you want to create an
ASP.NET MVC application, you must use a web application project.

Scenarios in which web application projects are the preferred choice include the following:
  • You want to be able to use the Edit and Continue feature of the Visual Studio debugger.
  • You want to run unit tests on code that is in the class files that are associated with ASP.NET pages.
  • You want to refer to the classes that are associated with pages and user controls from standalone classes.
  • You want to establish project dependencies between multiple web projects.
  • You want the compiler to create a single assembly for the entire site.
  • You want control over the assembly name and version number that is generated for the site.
  • You want to use MSBuild or Team Build to compile the project. For example, you might want to add prebuild and postbuild steps.
  • You want to avoid putting source code on a production server.


Scenarios in which Web site projects are the preferred choice include the following:
  • You want to include both C# and Visual Basic code in a single web project. (By default, a web application is compiled based on language settings in the project file. Exceptions can be made, but it is relatively difficult.)
  • You want to open the production site in Visual Studio and update it in real time by using FTP.
  • You do not want to have to explicitly compile the project in order to deploy it.
  • If you do precompile the site, you want the compiler to create multiple assemblies for the site, which can include one assembly per page or user control, or one or more assemblies per folder.
  • You want to be able to update individual files in production by just copying new versions to the production server, or by editing the files directly on the production server.
  • If you precompile the site, you want to be able to update individual ASP.NET web pages (.aspx files) without having to recompile the entire site.
  • You like to keep your source code on the production server because it can serve as an additional backup copy.

    MSDN: Web Application Projects versus Web Site Projects in Visual Studio

Tuesday 21 May 2013

Trying to install reporting services for Microsoft SQL server on Windows 7, but the option to install reporting services is disabled in the setup?

Before you install SQL Server 2005 Reporting Services, you must enable Microsoft ASP.NET and Microsoft Internet Information Services (IIS). To enable ASP.NET and IIS, follow these steps:
  1. In Control Panel, click Programs, and then double-click Programs and Features.
  2. In the User Account Control dialog box, click Continue.
  3. Click Turn Windows features on or off.
  4. In the Windows Features dialog box, expand Internet Information Services, expand Web Management Tools, expand IIS 6 Management Compatibility, and then click to select the following check boxes:
    • IIS 6 WMI Compatibility
    • IIS Metabase and IIS 6 configuration compatibility
  5. Expand World Wide Web Services, expand Application Development Features, and then click to select the following check boxes:
    • ASP.NET
    • ISAPI Extensions
    • ISAPI Filters
  6. Expand Common HTTP Features, and then click to select the following check boxes:
    • Default Document
    • Directory Browsing
    • HTTP Errors
    • HTTP Redirection
    • Static Content
  7. Expand Security, and then click to select the Windows Authentication check box.
Note If you do not enable all these features, the Reporting Services option does not appear in the Feature Selection dialog box of the SQL Server Setup program.

support.microsoft.com - kb934164

Wednesday 8 May 2013

How do I tell if my computer can run a 64-bit version of Windows?



To run a 64-bit version of Windows, your computer must have a 64-bit-capable processor. To find out if your processor is 64-bit-capable in Windows 7 or Windows Vista, do the following:
  1. Open Performance Information and Tools by clicking the Start button Picture of the Start button, and then clicking Control Panel. In the search box, type Performance Information and Tools, and then, in the list of results, click Performance Information and Tools.
  2. Do one of the following:
    • In Windows 7, click View and print detailed performance and system information.
    • In Windows Vista, click View and print details.
  3. In the System section, you can see what type of operating system you're currently running under System type, and whether or not you can run a 64-bit version of Windows under 64-bit capable. (If your computer is already running a 64-bit version of Windows, you won't see the 64-bit capable listing.)
To see whether a computer running Windows XP is capable of running a 64-bit version of Windows, do the following:
  1. Click Start.
  2. Right-click My Computer, and then click Properties.
    • If "x64 Edition" is listed under System, your processor is capable of running a 64-bit version of Windows.
    • If you don't see "x64 Edition" listed, your processor still might be capable of running a 64-bit version of Windows. To find out for sure, download and run the free Windows 7 Upgrade Advisor from the Windows 7 Upgrade Advisor webpage.


32-bit-and-64-bit-windows-frequently-asked-questions

Tuesday 7 May 2013

Report Builder 3.0 error : Connection Failed. Unable to connect to the server that is specified in the URL




Report Builder 3.0 error

"Connection failed.
Unable to connect to the server that is specified in the URL,'http://servername/Reports_SQLEXPRESS2008'.
Make sure the server is running, the URL is correct, and you have permission to use the server."


I saw other suggestions for fixing this error such as:

a) to make sure that the SQL Server Version is SQL Server 2008 R2 as Report Builder 3.0 does not support SQL Server 2008 or below.
or
b) to make sure you're not missing off the trailing slash in the URL, i.e. http://server/ReportingServices instead of http://server/ReportingServices/
or
c) even with SQL Server 2008 R2 - Report Builder 3.0 can't connect when supplied with the correct URL, even though you can successfully deploy from BIDS to the same URL.
etc.,

However, I found the cause can also be as simple as using the Report Manager URL, instead of the Web Service URL, in Report Builder's "Connect to Report Server" dialog box:




So, go into the Reporting Services Configuration Manager and make sure the URL you are typing into Report Builder is from the 'Report Server Web Service URLs' panel (see highlighted below):





and NOT from the Report Manager Site Identification URLs, as below:



Notice that TCP Port 80 is the default port and you will still be able to connect even if you leave out the default port number (:80) from the URL in Report Builder.

Saturday 4 May 2013

HResult 0x2, Level 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [2]. ...Microsoft SQL Server Native Client 10.0 : Login timeout expired.

With three SQL Server (Express) instances running, typing SQLCMD at a command line caused error:

HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in
stance-specific error has occurred while establishing a connection to SQL Server.
Server is not found or not accessible. Check if instance name is correct and if
SQL Server is configured to allow remote connections. For more information see
 SQL Server Books Online..
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.


Some online sources I checked for a solution suggested making sure that in addition to the 'Shared Memory' protocol, that 'Named Pipes' and 'TCP/IP' protocols were also enabled (via SQL Server Configuration Manager).

However none of those steps resolved the issue. It seems the error can also be the result (if you have multiple Sql Server instances running) of not specifying a particular Sql Server instance-name in the SQLCMD command line, eg:

C:\>SQLCMD

instead, this should be:

C:\>SQLCMD -S ServerName\InstanceName

Where ServerName and InstanceName are strings pointing to a) name of the server - aka 'Computer Name' - hosting your database and
b) the service name of a running instance of Sql Server, respectively.

For example the default instance-name for a free SQL Server Express installation is SQLEXPRESS, whereas for a licensed copy this is usually MSSQLSERVER.

Thursday 2 May 2013

Effective Clustered Indexes


Clustered indexes are the cornerstone of good database design. A poorly-chosen clustered index doesn't just lead to high execution times; it has a 'waterfall effect' on the entire system, causing wasted disk space, poor IO, heavy fragmentation, and more.

As a guideline, clustered Indexes should be Narrow, Unique, Static and Ever Increasing (NUSE).  Michelle Ufford Explains why...

www.simple-talk.com/sql/learn-sql-server


A clustered index determines the physical order of data in a table. A clustered index is analogous to a telephone directory, which arranges data by last name. Because the clustered index dictates the physical storage order of the data in the table, a table can contain only one clustered index. However, the index can comprise multiple columns (a composite index), like the way a telephone directory is organized by last name and first name....

A nonclustered index is analogous to an index in a textbook. The data is stored in one place, the index in another, with pointers to the storage location of the data. The items in the index are stored in the order of the index key values, but the information in the table is stored in a different order (which can be dictated by a clustered index). If no clustered index is created on the table, the rows are not guaranteed to be in any particular order....

Wednesday 1 May 2013

What are the ten most common questions asked at interviews?

1. Why do you want this job?computing interview

One of the most predictable questions and very important! You need to demonstrate that you have researched the employer and tie your knowledge of them into the skills and interests that led you to apply. For example, an interviewee with a small public relations agency might say:

"I'm always ready to take on responsibility and feel this will come more quickly with a firm of this size. A small firm also gives the chance to build closer working relationships with clients and colleagues and I've found through my past work experience that this makes an organisation more effective as well as more satisfying to work in."

Try to find some specific feature on which the employer prides themselves: their training, their client base, their individuality, their public image, etc. This may not always be possible with very small organisations but you may be able to pick up something of this nature from the interviewer.

More...