Setting the default document for you’re ASP .NET website or webservice, by using the Web.config

If you want to set the default document for you’re ASP .NET website or WCF webservice, you can use the Web.config. Add the following XML to you’re Web.config just before the end tag: </configuration>

<system.webServer> <defaultDocument> <files> <add value="MyWcfService.svc" /> </files> </defaultDocument> </system.webServer>

 

 

Dutch internet radio play list for XMBC

If you want to listen to Internet Radio in XBMC, you can save one of the *.pls or *.m3u files on the site [http://www.harmfrielink.nl/wiki/index.php/Internet_Radio], to a location where XBMC can open the file. Like a network share or local disk folder.

 

To add the Q-Music internet radio stream to XBMC:

image

  • Click on Add source

image

  • Add the folder containing the *.pls or *.m3u file and click on OK

image

  • Now click in the new folder, in my case [Internet Radio]

image

 

  • Click on the added *.pls or *.m3u playlist

image

 

 

For more information, see: http://wiki.xbmc.org/index.php?title=HOW-TO_play_internet_video_and_audio_streams

How to resolve: "Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive"

I was getting the error "Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive" on an ASP .NET 4.0 website. This was caused by the application pool targeting the wrong .net framework, change the application pool to the correct .net framework and the error will be resolved.

 

Error

image

Solution

image

How to restore a Microsoft SQL Server database from a *.bak file.

When I want to restore a Microsoft SQL Server database, I take the following steps:

  • Copy the *.bak file to a local folder on the databaserver, like [C:\Temp]
  • Open Microsoft SQL Server Management Studio and connect to the Microsoft SQL Server Instance, you want the database restored to
  • Kill all processes that are connecting to the database, you want to restore. In the Object Explorer:
    • Expand [Management]
    • Right click [Activity Monitor]
    • Click [View Processes]
    • Right click a process
    • Click [Kill Process]
  • To restore the backup (*.bak) file, in the Object Explorer:
    • Right click [Databases]
    • Click [Restore Database…]
    • Select the database, you whish to restore or type in a new database name
    • Click [From device]
    • Click [Add]
    • Select you’re database file and click [OK]
    • Check the column [Restore]
    • Click [Options]
    • Check Overwrite the existing database
    • Change the [Restore As] locations
  • Right click Databases > Restore Database

 

Screendumps

image

image

 

image

 

image

 

image

 

image

 

image

image

How to dynamically set the connectionstring of a typed dataset (*.xsd file) when using an ObjectDataSource in ASP .NET

If you are using a typed dataset (*.xsd) and you want to set it’s connection string, you can use the ObjectDataSource event OnObjectCreated.

 

protected void MyObjectDaDataSource_OnObjectCreated(object sender, ObjectDataSourceEventArgs e)
{
if (e != null && e.ObjectInstance != null)
{
SqlConnection connection = new SqlConnection("Data Source=SQLServerInstanceName1;
User ID=User1;Password=Password1;Initial Catalog=Database1;"); e.ObjectInstance.GetType().GetProperty("Connection",
BindingFlags.NonPublic | BindingFlags.Instance).SetValue(e.ObjectInstance, connection, null); } }