Wednesday, October 14, 2009

Get the result of dynamic SQL into a variable?

I needed this kind of functionality for something at work.

What you'll have to do is use dynamic SQL and sp_executeSQL. Try the following example:

CREATE PROCEDURE dbo.countTables
@dbname SYSNAME
AS
BEGIN
DECLARE @i INT, @sql NVARCHAR(512)

SET @sql = N'SELECT @i = COUNT(*) FROM '
+ @dbname + '.INFORMATION_SCHEMA.TABLES'

EXEC sp_executesql
@query = @sql,
@params = N'@i INT OUTPUT',
@i = @i OUTPUT

PRINT @i
END
GO

Some of the principles work for me - haven't gotten it to do what I need, but its a great help! Can work my way around my problem now.

Read the full article here.

Friday, September 18, 2009

DeepZoom overlaying

In a previous Blog entry I mentioned that I had SUCH a hassle to overlay a subimage with something else to make it look "seemless".

Well - I found a blog where they explained how they did it for a msi as a whole. So I will try and use it to fit my own needs - but here is that site. NJoy!

Wednesday, August 19, 2009

Uploading Silverlight Apps to Live

I uploaded a test app previously to live for testing purposes and couldn't remeber HOW today :)

So here are the steps:
> Add a file "manifest.xml" to the directory your XAP file is in... it should look something like this:

2.0
Test.xap


> Zip up the manifest.xml and *.xap and any other data directory you might have (eg. TestFiles)
> Log into the http://silverlight.live.com site.
> Go to Manager Applications
> Upload the Zip and follow the instructions
> Copy and paste the html you need into the web / blog u need to
> Done

Friday, July 17, 2009

ZOrder (ZIndex) in Silverlight 2

The Z-Order in Silverlight is (according to a blog I read) a bit messy.

So - what you can do to set the Z-Order is to change the Canvas.ZIndexProperty. This still doesn't work though, so one guy suggests to change the Opacity directly after changing this property. In my case the original Opacity was eg. 1... then it will look like this.

(I tested it and it works for me)

iCanvas.SetValue(Canvas.ZIndexProperty, 10);
iCanvas.Opacity = 0.9;
iCanvas.Opacity = 1.0;

Wednesday, July 8, 2009

Trying to make Delegates more "clear"

I often have to go back to see how to use delegates. I don't know WHY, but I keep forgetting the fundamentals of if...

Well - basically in Class B, you will create a Delegate. Within this class u will raise an event through the delegate. This event will then have to be handled in Class A (which uses Class B)..

CLASS B

CLASS A

Tuesday, July 7, 2009

Manipulating (scale & transform) an object in Silverlight

TransformGroup transformGroup = new TransformGroup();

RotateTransform rotateTransform = new RotateTransform();
rotateTransform.Angle = 180;
transformGroup.Children.Add(rotateTransform);

ScaleTransform scaleTransform = new ScaleTransform();
scaleTransform.ScaleX = .50;
scaleTransform.ScaleY = .50;
transformGroup.Children.Add(scaleTransform);

polygon.RenderTransform = transformGroup;

A fuller example here.

Friday, June 12, 2009

Testing my deepzoom page

I am playing around with some deepzoom stuff...
This might show nothing... just trying to make it work :)