RaSor's Blog

December 27, 2011

Windows links

Filed under: Administration, Windows — rasor @ 12:28 pm

This post will contain some Windows 7 helpfull stuff

Links

  • Link to Administrative Tools : shortcut:%systemroot%\system32\control.exe /name Microsoft.AdministrativeTools

The End

December 23, 2011

Cool powershell: From Xml to Csv in two lines

Filed under: Administration, Powershell, Sharepoint — Tags: — rasor @ 5:08 pm

With one-level xml you can convert xml to csv in two lines of powershell:

Create file Stsadm-EnumSites.xml:

cmd > stsadm -o enumsites -url http://teams > Stsadm-EnumSites.xml

<Sites Count="2">
  <Site Url="http://teams/" Owner="CONTOSO\XANDH" SecondaryOwner="CONTOSO\rinkr" ContentDatabase="WSS_Content_Teams" StorageUsedMB="0.6" StorageWarningMB="400" StorageMaxMB="500" />
  <Site Url="http://teams/commercial/AALT" Owner="CONTOSO\ECPD" ContentDatabase="WSS_Content_Teams" StorageUsedMB="77.4" StorageWarningMB="400" StorageMaxMB="500" />
</Sites>

Your converter code:

#read from file
[xml]$inputFile = Get-Content "Stsadm-EnumSites.xml"
#export xml as csv
$inputFile.Sites.ChildNodes | Export-Csv "Stsadm-EnumSites.csv" -NoTypeInformation -Delimiter:";" -Encoding:UTF8

Output: Stsadm-EnumSites.csv

"Url";"Owner";"SecondaryOwner";"ContentDatabase";"StorageUsedMB";"StorageWarningMB";"StorageMaxMB"
"http://teams";"CONTOSO\XANDH";"CONTOSO\rinkr";"WSS_Content_Teams";"0.6";"400";"500"
"http://teams/commercial/AALT";"CONTOSO\ECPD";;"WSS_Content_Teams";"77.4";"400";"500"

Cool :-)

Powershell with .NET

Filed under: Administration, NET, Powershell — rasor @ 10:01 am

This post is where I want to put how to do things from .NET in powershell.

There are some automatic conversions, for instance, that makes code different.

Using string.Split()

[char]$domsep = '\'
[string]$userid = "CONTOSO\XANDH"
#Split will in .NET accept a char[], but here it is OK to give the char directly without the array
$userid = $userid.Split($domsep)[1] #XANDH
#
#In most cases you can use the powershell way to do split as below, but that does not work, when the split char is '\'
#$userid = ($userid -split "\")[1] #XANDH
#In case of split char is '\' you need to escape it with an extra '\' as follows:
$userid = ($userid -split "\\")[1] #XANDH

Using String.IsNullOrEmpty()

if (-not [System.string]::IsNullOrEmpty($someString))
{
}

Add CRLF to strings

$crlf = "`n`r"
$Body = "Testing CRLF:" + $crlf
$Body += "Bla-bla"

Links:

December 4, 2011

SP2010 WSP Global or not?

Filed under: Deployment, Sharepoint — rasor @ 2:09 pm

In some cases a WSP is deployed to all WebApps. In other cases you can select which WebApps you will deploy the WSP to.

But what makes the difference?

When you in CentralAdmin goto System Settings – Manage Farm Solutions – Select a Wsp

If Contains Web Application Resource: Yes then it can be deployed to individual WebApps.

So how can you control this setting?

It seems to me that if you in Visual Studio goto Package.package – Manifest and see some line with <SafeControls> like

       <SafeControls>
        <SafeControl Assembly=”MyApp.Navigation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de0229056b231800″ Namespace=”MyApp.Navigation” TypeName=”*” />
      </SafeControls>

 then the package will have a WebApp resource.

You can add SafeControls via Package.package - Advanced.

 

November 18, 2011

Sharepoint 2010 deployment using Visual Studio

Filed under: Deployment, Sharepoint — rasor @ 12:40 pm

In a Sharepoint, where deveopment is in Visual Studio and deployment to ITest is via Wsp I have a solution structure like this:

- Solution:MyCom.MyWepApp

- Project:Common.ProjectForSeveralWebAppsWsp //A Wsp packaging project including code common to several webapps

- Project:MyWepApp.Wa.Layout //Some MyWepApp specific code
- Project:MyWepApp.Wa.WepParts //Some more MyWepApp specific code
- Project:MyWepApp.Wa.WepAppWsp //A Wsp packaging project for above two project

- Project:MyWepApp.Ca.CentralAdminWsp //A Wsp packaging project including some features for the CentralAdmin

There are three Wsp projects:
- One for deploy to MyWepApp (MyWepApp.Wa.WepAppWsp) and
- one for deploy to CentralAdmin (MyWepApp.Ca.CentralAdminWsp) and
- one for deploy to several dependant webapps (Common.ProjectForSeveralWebAppsWsp)

The MyWepApp.Wa.WepAppWsp project don’t include any code, but its Package.package includes the features and the dll’s for the projects above it.

For the MyWepApp.Wa.WepAppWsp project change the content of the .csproj file. You must unload the project before doing that.

You will find:

<Project>
  <!-- removed for clarity -->
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />
</Project>

Replace above with:

<Project>
  <!-- removed for clarity -->
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />
  <PropertyGroup>
    <PostBuildEventDependsOn>$(PostBuildEventDependsOn);CreatePackage</PostBuildEventDependsOn>
  </PropertyGroup>
  <PropertyGroup>
    <!-- Copy package for WebApplication (created from the whole solution) -->
    <PostBuildEvent>copy $(TargetDir)$(SolutionName).wsp $(SolutionDir)_Deployment\$(SolutionName)\Wa-Wsp\</PostBuildEvent>
  </PropertyGroup>
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{BB1F664B-9266-4fd6-B973-E1E44974B511}">
        <DeploymentConfigurations>
          <DeploymentConfiguration Name="Attach only (MyCom)" Description="No deployment - only attach">
            <DeploymentSteps>CKS.Dev.SharePoint.Deployment.AttachToIISWorkerProcesses;CKS.Dev.SharePoint.Deployment.AttachToSPUCWorkerProcess</DeploymentSteps>
          </DeploymentConfiguration>
        </DeploymentConfigurations>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>

This will copy the wsp to a folder \_Deployment\ under the solution directory and put it in a subfolder created for WebApp deployment (\Wa-Wsp\) oppsed to a subfolder for CentralAdmin (\Ca-Wsp\) deployment.

For the Common.ProjectForSeveralWebAppsWsp project you could instead have like this:

  <PropertyGroup>
    <BuildDependsOn>$(BuildDependsOn);CreatePackage</BuildDependsOn>
  </PropertyGroup>
  <PropertyGroup>
    <!-- Copy package for this project -->
    <PostBuildEvent>copy $(TargetDir)$(TargetName)2010.wsp $(SolutionDir)_Deployment\$(TargetName)2010\$(TargetName)2010.wsp</PostBuildEvent>
  </PropertyGroup>

Notice the DeploymentConfiguration. This you can add if you have CKSDev installed. Its purpose is to add a DeploymentConfiguration for the project, where you can attach to IIS without doing a full deployment. That part is usefull for those projects containing code for GAC/Bin

November 17, 2011

VS: Sgen error and Fusion Log Viewer

Filed under: Error, Utility, Visual Studio — rasor @ 8:53 am

Some SGEN errors:

I you in Visual Studio get the error (while building release):

SGEN : error : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Then read about it here: http://hashtagfail.com/post/5255977780/sgen-loaderexceptions-error

and further about Fusion Log Viewer: http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx

(more…)

November 15, 2011

OAuth bridge for WIF

Filed under: Identity Management, OAuth, WIF — rasor @ 4:09 am

OAuth Clients from .NET:

So how to access an OAuth protected resource (REST service) from a .NET webapplication in a generic manner?

Using WIF would be nice, since you would then just work just as if the OAuth protected REST service was an RP (and STS). In this case I think your app would be an active subject. But WIF does not implement OAuth.

But there are extensions for WIF. One can access OAuth through Azure Access Control Service (ACS) which then works as a bridge/gateway.
As far as I am aware ACS only provides access to OAuth 2.0 and not the older 1.0 protocol on which I believe Twitter is still using.
Here is a HowTo configure ACS to use Facebook as STS (FB uses OAuth 2.0).

But Azure is surely not free – I just don’t know what it costs.

Here is another sample - also bridging a WIF web app to OAuth/OpenID: http://southworks.github.com/protocol-bridge-claims-provider/.
It seems like that project is still only a sample.

If you just want to code towards OAuth without WIF, you can find samples like:

Twitter:

Yammer:

OAuth Services in .NET:

Create your own OAuth/OData service via ACS, WIF and EF: http://blogs.msdn.com/b/astoriateam/archive/2011/01/20/oauth-2-0-and-odata-protecting-an-odata-service-using-oauth-2-0.aspx

Links:

Links back from:

August 16, 2011

Powershell: Change encoding for Import-Csv

Filed under: Powershell — rasor @ 1:27 pm

Import-Csv does not accept ANSI files.
Also semicolon delimiter needs to be specified.

$personsFilename = ".\persons.csv"
#Change encoding from ANSI to UTF-8 by reading and saving
#-Encoding:String # = ANSI = Windows-1252 = iso-8859-1

#print content on screeen
Get-Content $personsFilename -Encoding:String | ft

#convert to UTF-8. type is alias for Get-Content
type $personsFilename -Encoding:String | Out-File $personsFilename"UTF8.csv" -Encoding:UTF8

#Import-Csv by default accepts UTF-8
Import-Csv $personsFilename"UTF8.csv" -Delimiter:";" | Where-Object {$_.UserID -ieq "ABC"} | ft
Import-Csv $personsFilename"UTF8.csv" -Delimiter:";" | Where-Object {$_.UserID -ieq "ABC"} | Export-Csv $personsFilename"FilteredUTF8.csv" -NoTypeInformation -Delimiter:";" -Encoding:UTF8
$personsFile = Import-Csv $personsFilename"UTF8.csv" -Delimiter:";"

August 11, 2011

SQL: Do Accent Insentitive (AI) and Case Insentitive (CI) join

Filed under: Databases, SQL — rasor @ 11:04 am

SQL Tip:

--do Accent Insentitive (AI) and Case Insentitive (CI) join
select *
from [TableA] a
left outer join [TableB] b
	on a.[AID] COLLATE Latin1_general_CI_AI = b.[AID] COLLATE Latin1_general_CI_AI

A couple of links:

August 5, 2011

Upgrading MOSS07 WSPBuilder sln to SP2010 sln

Filed under: Administration, Sharepoint — rasor @ 8:01 am

Your old MOSS/WSS sln build using WSPBuilder can be converted to a SP2010 project using VS2010 Project template

  • Download and install http://cksdev.codeplex.com/
  • You will need a SiteColl to use for debug your converted solution:
    • Create a DNS entry for the hostheader e.g. myapp.mycom.eu
    • Create a WebApp e.g. http://myapp.mycom.eu:80
    • Create a SiteColl e.g. just the root: “/”.
  • Start Visual Studio 2010 as administrator (right clik – run as admin).
  • Create a target solution – an Empty Solution – found under Other Project Types – Visual Studio Solutions. Choose framework 3.5. Create it in another path than the MOSS solution.
  • Convert a MOSS project by adding a new SharePoint 2010 project Import WSPBuilder Project (from CKSDev).
    • Enter site http://myapp.mycom.eu/ and press validate
    • Enter path to the corresponding MOSS project (source)
    • If convertion fails then remove the project from the target solution and delete the created project folder and try again after fixing something.
  • xx

Ongoing….

August 3, 2011

Upgrading Moss07 WSPBuilder07 sln to a WSPBuilder10 in a SP2010 sln

Filed under: Administration, Sharepoint — rasor @ 7:45 am

The old MOSS07 solutions uses WSPBuilder07

Strategy is to upgrade the MOSS07 solution to SP2010 using WSPBuilder10 for existing solutions.

New solutions should use the new SPI file layout
http://sharepoint.mindsharpblogs.com/Todd/archive/2010/08/24/Visual-Studio-2010-SharePoint-Project-SPIs.aspx. It replaced WSPBuilder.

(more…)

January 5, 2011

TFS2010: Build, deploy, test links

Filed under: Deployment, TFS, Virtual, Visual Studio — rasor @ 9:04 am

Ports Required for Installation of Team Foundation Components
http://msdn.microsoft.com/en-us/library/dd578664.aspx

How to: Deploy an Application on a Virtual Environment
http://msdn.microsoft.com/en-us/library/ee471614.aspx

Build and Deploy Continuously
http://msdn.microsoft.com/en-us/library/ee308011.aspx

Understanding a Team Foundation Build System
http://msdn.microsoft.com/en-us/library/dd793166.aspx

Define a Build Using the Default Template
http://msdn.microsoft.com/en-us/library/dd647547.aspx#configs

Control Where the Build System Places Your Binaries
http://msdn.microsoft.com/en-us/library/ff977206.aspx

Team Foundation Build Activities – InvokeProcess
http://msdn.microsoft.com/en-us/library/gg265783.aspx#Activity_InvokeProcess

November 24, 2010

Terminal Server access

Filed under: Administration — rasor @ 6:06 am

A couple of things to set for getting Remote Desktop access to a server for a domain user:

If you need Allow logon through Terminal Service, then there is a shortcut to add users on the server to the local group Remote Desktop Users:

  • Right-Click your server – Properties – Remote – Select Remote Users – Add the user

Above requires Remote Desktop Users to have permission in:

  • Admin Tools – Local Security Settings\Local Policies\User Rights Assingment – Allow log on through Terminal Services
  • Also Administrators should have this permission

Ensure that the user is not denied through

  • Admin Tools – Local Security Settings\Local Policies\User Rights Assingment – Deny log on through Terminal Services

If you need Terminal Server User Access, then on the server go to:

  • Admin Tools – TS Configuration\Connections
  • Select connection – Properties – Permissions
  • Add local group Remote Desktop Users – Allow User Access and Guest Access.
  • Make suer that Everyone is not denied

Disable loopback check

There might be some local web sites that you want to access using Remote Desktop, but won’t let you authenticate with your valid password. It writes An account failed to log on (status: 0xc000006d, eventid: 4625) in the security eventlog.

This could be due to due to loopback check. The fix is to disable that check:

http://code-journey.com/2009/09/17/account-failed-to-log-on-0xc000006d-unable-to-load-website-from-local-server/

November 11, 2010

Textpad tips

Filed under: TextPad — rasor @ 12:17 pm

Using Textpad a few tips are here listed:

(more…)

November 3, 2010

Miscellaneous VB6 and VBA upgrade

Filed under: VB6 — rasor @ 5:51 am

Links:

July 20, 2010

SP2010: Pattern & Practices – SP Guidance 2010

Filed under: Sharepoint, Study — rasor @ 8:17 am

Content from Pattern & Practices – SP Guidance 2010:

(more…)

June 10, 2010

.NET3.0: Extension method sample

Filed under: NET — rasor @ 8:38 am

Needed a sample of extension methods both in c# and VB.NET

(more…)

June 9, 2010

EMS Commandlets

Filed under: Exchange, Powershell — rasor @ 11:42 am

Just for a nice reference…

Exchange 2010 Cmdlets http://technet.microsoft.com/en-us/library/bb124413.aspx 

(more…)

June 7, 2010

List of Utilities

Filed under: Administration, Apps, Sharepoint, Utility — rasor @ 11:13 am

Miscellaneous

Debug/Trace tools

Test

Sharepoint tools

Powershell tools

Windows OS tools

Network tools

IIS Tools

  • SelfSSL //Certificate for IIS6
  • Logparser, Matabase Explorer //Other IIS6 resource kit tools – see link above

Web/WebService

April 4, 2010

Virtualization: Running VirtualBox on a Windows 7 laptop – Windows 2008 R2 Server guest

Filed under: HW, Network, Virtual — rasor @ 6:46 pm

Using VirtualBox as hypervisor on a laptop eases usage of WLAN and USB on the guest OS.

This post is based on using VirtualBox 3.1.6 on Windows 7 (64 bit) with Windows 2008 R2 server, 64 bit, Standard edition.

Out of the box Windows 7 installed drivers for the WLAN in my laptop (with CPU i7 720) and for the full HD resolution video card. Nice.

(more…)

March 23, 2010

MVC: Incorporate into Sharepoint

Filed under: Deployment, MVC, Patterns, Sharepoint — rasor @ 7:10 pm

Before trying out Sharepoint with MVC I’ve tried to think of what to expect:

Three points to think about when adding MVC to Sharepoint:

  1. Installation
  2. Execution Model, routing and navigation
  3. Visual Controls

(more…)

March 15, 2010

Browser Debugging: Fiddler for Firefox

Filed under: Debugging — rasor @ 1:53 pm

For inspecting HTML DOM and CSS there is IE Developer Toolbar for IE and Firebug for Firefox.

For inspecting HTML request and responses there is Fiddler for IE.
But Fiddler can also be used in Firefox with FiddlerHook:

FiddlerHook

Have also a look at a huge load of other Firebug extensions.

The end.

March 11, 2010

VS2010: Test upgrade a solution

Filed under: NET, TFS, Uncategorized, Visual Studio — rasor @ 4:07 pm

HowTo test a Visual Studio Solution upgrade to VS2010 RC

  • Make a copy of the whole solution
  • Open the solution in existing version like VS2008
  • Tools – Options – Source Control: Change from TFS to None.
  • Right-Click the solution folder – Remove the ReadOnly attribute – subdirectories included
  • Optional: Use tool like Agent Ransack to find all TFS files (.vssscc and .vspscc) from the solution folder - subdirectories included. Delete them
  • Disconnect you network connection to avoid accidentially changing in TFS
  • Open the solution in VS2010 RC
    => The Conversion wizard starts.
  • Press Next
    Upgrade to Framework 4.0?
  • Press No, when asked to upgrade to Framework 4.0
  • You’re done. Play around.

The End

VS2010: Install on XP SP3

Filed under: Deployment, Visual Studio — rasor @ 10:12 am

While waiting for Visual Studio 2010 Ultimate RC to install I grapped images of what is being installed:

(more…)

March 9, 2010

WS: .NET Web Services Security

Filed under: WCF — Tags: — rasor @ 8:10 pm

NET Web Services Security Nice to have links:

Misc. ASMX

The End.

SP2010: Add from Andrew Connell

Filed under: Powershell, Sharepoint, Study — rasor @ 4:42 pm

Update: More Free Online Webinars!

http://www.criticalpathtraining.com/Schedule/Webcasts/Pages/default.aspx

Ranging Thursday, April 7, 2011 2p-3p EDT - Thursday, July 7, 2011 2p-3p EDT


Received an email with this Advertisement from Andrew Connell:

Announcing our No Cost SharePoint 2010 Webinars!
 
Critical Path Training is pleased to announce it will be offering a no cost 10-week SharePoint 2010 webcast series starting on March 25th, 2010. These 1-hour webcasts will feature the industry leaders in SharePoint 2010 developer training. SharePoint MVP’s Andrew Connell, Ted Pattison, Scot Hillier, Asif Rehmani, and David Mann will conduct these no cost webcasts
(more…)

February 28, 2010

TFS: Avoid corresponding paths on VPC’s

Filed under: TFS, Virtual, Visual Studio — rasor @ 11:35 am

Have you ever experienced that you and another developer has a copy of the same VPC and wants to Check Out from TFS to the same path on each of your copy?

If yes, then you also know that TFS won’t allow this. I forgot what error it comes with.

You could change local path or computer name to get around this, but it might not be without trouble.

If you cannot change local path due to it might give you some extra trouble
and you don’t want to change the computer name – this can also cause trouble for SW like SharePoint – then:

Give each user each own virtual path to the C: drive.

(more…)

WordPress: Blog to your Facebook wall

Filed under: Blog, WebApps — rasor @ 10:25 am

There might be a ton of ways to put your WordPress postings out on other communities.

WordPress has a way it calls Publicize.

WordPress Publicize

This function can publich to Facebook, Twitter an Yahoo.

The End.

February 19, 2010

Hw: Touch Screen, Accelerometer and other devices

Filed under: HW, Mobile, Surface — Tags: , , , , , — rasor @ 4:09 pm

Inspired by Thomas Martinsen, a dk Silverlight guru, this post collects a few ideas about the less used user interfaces in the PC world, but easily obtainable in the mobile world.

Having six devices to code towards in mind:

  1. Touch Screen
  2. Accelerometer
  3. Bluetooth
  4. RFID
  5. GPS
  6. SMS

Many cell phones has all 6 pieces of HW included. So if you developed mobile services that could expose the HW facilities to a client PC (connected either through mini-USB, old fashioned serial, wlan or bluetooth), then you would get enormous application possiblities.

 I blogged about Accelerometer, RFID and SMS usage before. At that post the accelerometer was a Wii NunChuck . Nowadays the accelerometer is build into the mobile phone and API’s has emerged.

WinMo 6.5 SDK was removed last month. Maybe WinMo 7 SDK is what Microsoft developers should have to get API’s for the 6 devices?

 Thomas has spoken about touch screen development towards a device from Microsoft called Surface. I wouln’t be surprised if he is experienced in  the field. Join the LinkeIn group.

Another keyword is Panel PC.

Currently I won’t collect more info, but I might return with an update to the post one day.

So for now you might just be inspired as well :-).

The End.

Pattern: Dependency Injection

Filed under: NET, Patterns, TDD — Tags: , — rasor @ 12:29 pm

If something deserves blogging, patterns are one of those candidates, since they often needs explanation.
If the user miss the point he will easily end up as Patterns Happy.

Dependency Injection (DI) is an extended Factory pattern that enables dynamic configuration/plugin.

Links:

The End.

Plugin: WordPress bookmarklets

Filed under: Blog, WebApps, WinApps — rasor @ 10:20 am

If you are a WordPress blogger you will love the bookmarklet Press This.

(more…)

Plugins: Delicious Sidebar, Toolbar and Bookmarklets

Filed under: Blog, WebApps, WinApps — rasor @ 8:27 am

If you are a http://delicious.com user you might want to install the Sidebar

(more…)

February 15, 2010

Com: HowTo call .NET from COM

Filed under: NET, VB6 — rasor @ 11:59 am

How do you register a .NET assembly for being callable from COM like from VB6?

Lets say you have a assembly called MyLib.dll.

Inside you have a namespace called MyNs.MyLib and a class called MyCls.

(more…)

February 10, 2010

Exch2007: Speedup EMS startup time

Filed under: Exchange, Powershell — rasor @ 12:25 pm

How to increase Exchange Management Shell (EMS) startup time from 35 sec to 5 sec:

  • Follow link Update-gac.ps1 to get a ps1 script.
  • Execute the script. Output:
powershell .\update-gac-exch.ps1
Already GACed: Microsoft.PowerShell.Commands.Management.dll
Already GACed: Microsoft.PowerShell.Commands.Utility.dll
Already GACed: Microsoft.PowerShell.ConsoleHost.dll
Already GACed: Microsoft.PowerShell.Security.dll
Already GACed: mscorlib.dll
Already GACed: System.Configuration.Install.dll
Already GACed: System.Data.dll
Already GACed: System.DirectoryServices.dll
Already GACed: System.dll
Already GACed: System.Management.Automation.dll
Already GACed: System.Management.dll
Already GACed: System.Xml.dll

After doing that starting EMS should be much quicker.

Another link

The End.

February 8, 2010

Exam: New second shot offer @ MS

Filed under: Study — rasor @ 9:37 am

If you want to try to pass a Microsoft exam, there is a new Second Shot offer:

  • Dates: January 13, 2010 – June 30, 2010

http://www.microsoft.com/learning/Career/en/us/career-offer.aspx#certification

And for the wannabe masters there is a discount offer here:

http://www.microsoft.com/learning/en/us/certification/master.aspx#tab3

SQL: Replace CRLF

Filed under: SQL — rasor @ 8:02 am

So how to remove CRLF from a select mycolumn from mytable?

Here is a Catch-All solution:

REPLACE(REPLACE(REPLACE(REPLACE(MyTable.MyColumn, CHAR(13) + CHAR(10), ' '), CHAR(10) + CHAR(13), ' '), CHAR(13), ' '), CHAR(10), ' ')

Thanx to Rex Tang.

But I just want to remove CRLF:

REPLACE(MyTable.MyColumn, CHAR(13) + CHAR(10), '')

February 5, 2010

MOSS07 Search

Filed under: Search, Sharepoint — rasor @ 2:41 pm

Links:

SharePoint: Study

Filed under: Sharepoint, Study — rasor @ 2:15 pm

Online learning material.

SP2010:

MOSS2007/WSS30:

Miscelaneous skills to study:

The end

February 1, 2010

Sharepoint Saturday EMEA – KPI roll-up

Filed under: Sharepoint — rasor @ 10:25 pm

Didn’t you meet up at Sharepoint Saturday EMEA?

Too bad – I still haven’t recovered fully yet.

Even though most of the presentations were in the SP2010 sign, some WSS30/MOSS2007 presentations could also blow you away.

One of them were KPI roll-up in SharePoint 2007 (WSS and MOSS) by Christophe Humbert. Get the Slides.

(more…)

January 29, 2010

CPU: Choosing a CPU for virtualization

Filed under: HW, Virtual — rasor @ 8:17 am

When you need to host several virtual machines (VM) in a PC, the CPU must support virtualization.

Good performance is reached, when there is a logical CPU and a Disk present for each VM.

(more…)

January 19, 2010

SP2010 Beta: Installation

Filed under: Deployment, HW, Network, Sharepoint, Virtual — rasor @ 7:34 pm

In preparing for installing a developer environment with SharePoint2010 Beta I have collected a little info.

Everybody point to Jie Li as the expert.

But do also check out Setting Up the Development Environment for SharePoint Server.

64 bit OS and SW on top is required. If the 64 bit  OS is not available you can use VMWare on a 32 bit OS to host 64 bit guest OS’s.
For a workstation (like Windows 7) a VMWare licence is not free. On a server, the licence is free. 

(more…)

Office2007, MOSS2007 – CRM OBA

Filed under: Sharepoint, Unified Communications, VSTO — rasor @ 7:52 am

I’ve been skimming the book 6 Microsoft Office Business Applications for Office SharePoint Server 2007.

There is an inspiring chapter about a CRM app, that uses outlook for forms generator and offline functionality. Sharepoint is used for workflow engine and doclib and MS CRM as backend.

Some slides from SalesOutlook CRM gives a little similar idea, but the book gives you the complete idea.

But the book Programming Microsoft Office Business Applications (Pro – Developer) even provides two online chapters:

More samples available on Office Business Applications Developer Center.

The late Patrick Tisseghem also has some nice OBA slides. His blog on the OBA subject contains several postings.

Finally there is the OBA homepage to explore.

January 18, 2010

Microsoft offerings – and BizSpark content

Filed under: Access, Apps, Biztalk, Databases, Deployment, NET, Network, Sharepoint, SQL, Visual Studio — rasor @ 6:02 am

Was looking for a Microsoft offer that could give OS’s and Servers to play with at home. Found a few interesting programs: 

(more…)

January 17, 2010

SP2010: Adding dll’s to WSP

Filed under: Deployment, Sharepoint, Visual Studio — rasor @ 3:25 pm

Just nice to know. About adding 3rd party dll’s to WSP packages.

VS2010:

http://blog.mastykarz.nl/including-additional-assemblies-wsp-visual-studio-sharepoint-development-tools/

And using WSPBuilder:

http://keutmann.blogspot.com/2009/08/wspbuilder-extensions-ver-106.html

January 15, 2010

SP2010 and Office2010 – My first preview

Filed under: Biztalk, HW, NET, Sharepoint, Unified Communications, Virtual, VSTO — rasor @ 7:18 am

I must admit that I am impressed.

Going to Win 2008 R2, Exchanserver 2010, Office 2010 and SharePint 2010 alltogether really makes a difference. I am usually not easy impressed.

I’ve attended Campus Days 2010 in CPH – DK. The program was designed for IT Pro’s, but had great first view tracks and a lab, where you could try it all out.

(more…)

December 21, 2009

SQL2005: Create a unique key with Row_number()

Filed under: Excel, SQL — rasor @ 6:20 pm

A datawash solution:

Problem: From Active Directory I had a long list, where column alias was not unique.
Instead of do any manual filtering away the aliases that were found more than once, I just wanted SQL server to throw away the duplets, leaving only one alias bin the list.
(more…)

December 18, 2009

ASP post to ASP.NET upgrade and encoding error

Filed under: Debugging, NET, VB6, Visual Studio — rasor @ 7:16 am

I wanted to debug some .NET code from an oldfashioned ASP page. the ASP page called a COM enabled .NET component using Server.CreateObject().
The ASP page received a form posting before the call to the component. 

If I replaced that serverside code with ASPX, then I instead could instanciate the .NET component through a “new MyNamespace.MyComponent()” instead of the “Server.CreateObject()”. By setting the posing ASP form as the startup url like http://mysite/myform.asp, I was then able to set a breakpoint in the new aspx page that received the form posting (myform_actions.aspx). The debugging could nicely continue in the .NET component. 

When you do this trick of upgrading the code for the received form post, there is a few things to consider: 

  • You need to reauthenticate in some way
  • The Session state from ASP is not shared with you ASPX session. You need to recreate any session variables in your ASPX session, if you need to use them in your migrated code.
  • Encoding of the form post needs to be done.

The migration worked fine and the debugging was a releave.
But initially I haven’t set the encoding. 

When the form post entered the myform_actions.aspx I could see (using Fiddler) that a posted “ø” was sent correctly as “%F8″, but it was tranlated to “?”, when read from Request(“MyTextInputCtrl”). 

There were some links telling me about the problem:

http://bytes.com/topic/asp-net/answers/491522-encoding-problem-when-posting-text-between-classic-asp-asp-net
http://www.w3.org/TR/html4/interact/forms.html#adef-accept-charset
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfGlobalizationSection.asp

The latter link fixed the problem:

<configuration>
   <system.web>
      <globalization
         requestEncoding="iso-8859-1"
         responseEncoding="iso-8859-1"/>
   </system.web>
</configuration>

The accept-charset I did not use. It probably is not understood in a HTTP/1.0 post.

The End.

November 26, 2009

SQL2008: Read committed snapshot

Filed under: Databases, SQL — rasor @ 8:36 am

I was just told not to use

READ UNCOMMITTED also called dirty read in SQL 2008. A new possibilty exists:

READ COMMITTED SNAPSHOT

The problem with the first one is that if conn A reads a large bit, conn B do update, conn A reaches the updated bit and reads that, conn B rolls back, then conn A got illegal data.

If using the snapshot read, then conn A reads only on a snapshot as long as conn B is doing update. This snapshot contains the before transaction data.

This makes sence because had connection B just been a little later, then it would have been the same situation as with the snapshot option.

Thanks to Jesper Johansen

November 16, 2009

WSS30/MOSS07: Replace WebApp pool user

Filed under: Administration, Sharepoint — rasor @ 3:58 pm

During a fault finding situation I ran into the problem where I wanted to replace the system account for the application pool for a WebApp.

(I got an “Service unavailable” error message when even the settings.aspx on the site was called, if I remember correct.) 

I succeeded to create a new web application user manually by doing following:

  1. In Windows Local Users & Groups: Create a new app pool user. Lets call him sp_proc_myapp1
  2. Put the new user into the groups WSS_WPG and IIS_WPG
  3. In SQL manager: Create a new SQL login for the new user and set the default db to wss_content_myapp1
  4. SQL login user mapping:
    • sp_adminContent_xxx: public, WSS_Content_AppPools
    • sp_Content: public, WSS_Content_AppPools
    • wss_content_xxx: public, db_owner
  5. Replace the user on the Application pool from the IIS manager

But instead of doing it manually like in the example above you can just use Central Admin to create a new web application and use the user from step 1 above as app pool user. Then Central Admin does the rest for you :-) and you only have to change app pool user in step 5.

October 29, 2009

OLEDB: Create connection string

Filed under: Access, Administration, Databases, SQL — rasor @ 7:20 am

A little trick to create a OLEDB connection string:

  • On a Windows desktop (or any other folder) create a new text file.
  • Rename the file to MyNewConnection.udl
  • Double click the file which will open the guide Data Link Properties.
  • Insert your connection data, test the connection and close the guide by pressing OK
  • Open the file in your favorite text editor and view the connectionstring

Examples of generated connection strings:

  •  Provider=SQLOLEDB.1;Password=MyPsw;Persist Security Info=True;User ID=MyUser;Initial Catalog=MyDb;Data Source=mydbserver\mydbinstance
  • Provider=MSDASQL.1;Persist Security Info=False;MyUser ID=user1;Data Source=MyOdbcDsn;Initial Catalog=MyDB

Thanx to Rakesh Moturi

The End

Older Posts »

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.