Uploading blobs to Azure Storage
Made a lot easier with this tool:
The timestamp field in SQL Server (which is a unique number for every insert/update in the database) can be accessed in ActiveRecord as a byte array (of 8 bytes):
[Property] public Byte[] Timestamp { get; set; }
This can be converted to a hexadecimal string representation with the BitConverter class:
return BitConverter.ToString(Timestamp).Replace("-", String.Empty);
Timestamp is very useful if you want to keep track of changes to records, as SQL server manages the field for you, and has total precision, unlike a datetime field.
A silverlight control running in your browser normally loads data from your server via WCF. By default, the endpoint is pulled out of your .config file, which is fine. However, suppose the control is loaded using slightly different domain names (www.foo.com and foo.com). In this case, cross-site scripting prevention will fail the request when the host names doesn’t perfectly match.
The way around this is to programatically set the enpoint URI, which you can do like this:
var client = new FooSoapClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress( "http://" + System.Windows.Browser.HtmlPage.Document.DocumentUri.Host + "/Foo.asmx");
The control will now work regardless of the domain name.
Reply
You must be logged in to post a comment.