January 2008 Archives

SSIS: Updating Variables From Resultset Data

January 29, 2008

Problem: In SSIS, you want to update a variable from a Script Component embedded in a Data Transform task. You get an error message reading "the collection of variables locked for read and write access is not available outside of postexecute". What's up?

ssis resultset variables.jpg

Validating XML Via Embedded XSD Schema

January 17, 2008

Problem: You have some XML, and you need to validate it against a custom schema that you want to deploy with your .Net 2.0 assemblies. Issues addressed: opening the file and handling the schema validation.

Solution: The XmlSchema class contains a Read method that takes a stream as a parameter. Nicely matching up to that, you can open a stream from an embedded resource (thank you, attilan.com).So, embed the schema. In Visual Studio's Solution Explorer, right-click the schema file and choose properties. Change the Build Action to "Embedded Resource".

Viewing Embedded Images in HTML E-mail (Base64)

January 11, 2008

Problem: you have image data from an HTML e-mail, but don't know what to do with it. When you save it to disk it comes out with a weird string instead of binary data.

Solution: pretty simple, you just have to know the terms. This string of data is actually Base64 encoded, which means that the binary data has been converted to a text string for easy transmission over text protocols. .Net Developer's Journal has a good full explanation. All you have to do is convert the string over to a byte array using Convert.FromBase64String, then save your new byte[].

About this Archive

This page is an archive of entries from January 2008 listed from newest to oldest.

December 2007 is the previous archive.

February 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.



OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.12