Category Archives: Tools

Downloading Help files (CHM) from the Web

This has confused me for a while and I just realized the solution. A few weeks ago I tried to download the Sharepoint help documentation which si a CHM file. I could never read it. The contents were there (on the left) but the actual documentation would not appear.

The problem, I just realized when I downloaded another CHM a few minutes ago, is that the content is blocked because it was downloaded from the internet. If you look at the properties of the file, you will see that you can unblock the file very easily! I just never thought to look at that before now. Duh. 🙂

Just unblock it and you will be good to go!



www.acehaid.org

SELECTs, UNIONs and ntext columns

This bit me (again) today. It had been so long since the last time that I had to google for help.

Problem: Select colA, colB, colC from tableA UNION Select colA, colB, colC from tableB when one of the columns is an ntext will result in this confusing error:

“The text, ntext, or image data type cannot be selected as DISTINCT.”

Thanks to this Wrox forum thread, I got a  quick lesson of why I get an error regarding a clause that I’m not even using (DISTINCT) and a reminder to use UNION ALL instead of just UNION.

In case that thread ever disappears I will paste the key info from Jeff Mason.

The UNION operator by default eliminates duplicate rows from the resultset.  The duplicate eliminating operation is similar to a SELECT DISTINCT.  You can’t use SELECT DISTINCT on a column that is text type.

Try UNION ALL which will not remove duplicates, or remove the text column(s).

www.acehaid.org

Wasn’t the point of sharepoint to make your life easier?

okay I give up 🙂

You know it’s bad when I do this in my blog. I have tried the newsgroups and googled myself to death and the clock is ticking…

I have been having a problem with getting file objects with SPWeb.GetFile for about a day. No matter what file name/path I pass into GetFile(), I get strange results: SPFile.Exists=false and many operations such as SPFile.Checkout fail. However, SPFile.OpenBinary works just fine. I have had this happen coding this directly into an ASP.NET page as well as when buildling a web service. All of the documentation says “this is the way to do it” but I find nothing that says “but if it doesn’t work…” – you know like when you are working with Beta software. I can’t imagine I am the first person who has had this problem!

To dig further into the problem, I built a test where I iterate through the webs and folders and then files in the folder, I am then taking a string representing the file (either ServerRelativeURL or some flavor of it) and creating a new file from it. Then if I attempt to SPWeb.GetFile(filepath) using the various paths and you can see that still, I consistently get SPFile.Exists=false even when I know the file is there.

Having iterated to a file in a folder with “For Each fileA As SPFile In folder.Files”

fileA.exist : True
fileA.Name: “ABR.XLS”
fileA.URL: “Shared Documents/ABR.XLS”
fileA.ServerRelativeURL: “/mysite/nn/Shared Documents/ABR.XLS”

create new files with spweb.getfile and test file.exists
(ServerRelativeURL) File Exists? ( /mysite/nn/Shared Documents/ABR.XLS ) False
File Exists?? ( mysite/nn/Shared Documents/ABR.XLS ) False
File Exists? ( nn/Shared Documents/ABR.XLS ) False

So, what gives here?



www.acehaid.org

Some clarity on public and private keys and their role in encryption

This is something I have learned is very confusing to people, as it was the most often asked question in my Security Basics for WSE talk. I have learned now to explain it as part of the talk, but thought to put it here as I had the same question asked in an email this morning.

You can encrypt data with either the public or private key.

It depends on your goal.

If your goal is confidentiality (i.e. only the recipient should be able to read/comprehend the message) then you want to encrypt with their public key so taht only their private key is able to decrypt the message.

If your goal is authentication (for example, when encryption is used as the process of digital signatures, the source of the message needs to be authenticated) then you need to encrypt with your private key. The recipient then uses your public key to decrypt and that will ONLY work with a message that was encrypted with the correct private key.

If you encrypt with a private key, you can only decrypt that message with the public key from the pair.

If you encrypt with the public key, you can only decrypt the message with the private key from the pair.

It is definitely confusing when you see some cases (eg: confidentiality) where the public key is used to encrypt and others (eg: digital signatures) where the private key is used to encrypt.

www.acehaid.org

XML/Http -> AJAX -> Atlas

Since February, the blogosphere has been abuzz with AJAX, which had been used by GoogleMaps and impressed the pants off of a lot of web developers. AJAX incorporates XMLHttp but is not limited to I.E. Now it is “hold the presses” at Microsoft who is planning [read more]

[A DevLife post]

TechEd Speakers Charity Auction http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5587400881