The mysteries of software development and networking... RSS 2.0



 Thursday, September 20, 2007

I've completed a comprehensive sample application integrating Windows Communication Foundation, ASP.NET and TRUVEO search into a custom search engine. Check it out here.

Thursday, September 20, 2007 1:01:55 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL | ASP.NET | WCF
 Tuesday, September 18, 2007

Sometimes, like before starting a build, you want to see how many files are checked out, which pending changes there are and who still has pending work. VSTS does not offer a standard report for this, but you can use the tf.exe command line tool to query for this information:

tf status "$/ProjectName"  /server:ServerName /recursive /user:*

Tuesday, September 18, 2007 10:34:51 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Team System
 Tuesday, September 11, 2007

I needed to export all rights granted to a specific role from a SQL Server 2005 database in order to check these roles into our TFS server.

/*
	Script	:	ExportRole.sql
	Version	:	1.0
	Date	:	11-09-2007
	Author	:	Mark Blomsma, Develop-One (www.develop-one.com)
	Desc.	:	Export all rights for a role from a SQL Server 2005 database.
			Including Service Broker messages, contracts and services.
*/

-- Role is the parameter for this procedure
DECLARE @Role VARCHAR(40)
SET @Role = 'Rolename goes here'

-- Retrieve the roleid for the role which we need to export
DECLARE @RoleId int
SELECT 
	@RoleId = dp.principal_id
FROM
	 sys.database_principals dp
WHERE
	dp.name = @Role

-- Declare a temp table for collecting results.
-- Each grant statement will be a line in the results table.
DECLARE @Result 
TABLE
	(
		Line VARCHAR(256)
	)

-- Use the current database
INSERT INTO
	@Result (Line)
VALUES
	('USE [' + DB_NAME() + ']')

-- Declare variable for retrieving data from cursor
DECLARE 
	@permission_type	char(4),
	@permission_name	sysname,
	@object_name		sysname,
	@object_type		char(2),
	@type_desc			nvarchar(60)

-- Declare object cursor for retrieving rights on database objects.
DECLARE objectCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT     
	p.type AS permission_type, 
	p.permission_name, 
	o.name, 
	o.type AS object_type, 
	o.type_desc
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.objects AS o ON p.major_id = o.object_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	o.type, o.name

OPEN 
	objectCursor;

-- Fetch first row with object permissions
FETCH NEXT FROM 
	objectCursor
INTO
	@permission_type,
	@permission_name,
	@object_name,
	@object_type,
	@type_desc	

-- Loop through object permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		objectCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name,
		@object_type,
		@type_desc	
END

-- Cleanup cursor
CLOSE 
	objectCursor
DEALLOCATE
	objectCursor

-- Declare object cursor for retrieving rights on message types.
DECLARE messagetypeCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT DISTINCT    
	p.type AS permission_type, 
	p.permission_name, 
	mt.name
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.service_message_types AS mt ON p.major_id = mt.message_type_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	mt.name

OPEN 
	messagetypeCursor;

-- Fetch first row with message type permissions
FETCH NEXT FROM 
	messagetypeCursor
INTO
	@permission_type,
	@permission_name,
	@object_name	

-- Loop through message type permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON MESSAGE TYPE :: [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		messagetypeCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name
END

-- Cleanup cursor
CLOSE 
	messagetypeCursor
DEALLOCATE
	messagetypeCursor


-- Declare object cursor for retrieving rights on contracts.
DECLARE contractCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT DISTINCT    
	p.type AS permission_type, 
	p.permission_name, 
	c.name
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.service_contracts AS c ON p.major_id = c.service_contract_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	c.name

OPEN 
	contractCursor;

-- Fetch first row with message type permissions
FETCH NEXT FROM 
	contractCursor
INTO
	@permission_type,
	@permission_name,
	@object_name	

-- Loop through message type permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON CONTRACT :: [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		contractCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name
END

-- Cleanup cursor
CLOSE 
	contractCursor
DEALLOCATE
	contractCursor



-- Declare object cursor for retrieving rights on services.
DECLARE serviceCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT DISTINCT    
	p.type AS permission_type, 
	p.permission_name, 
	s.name
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.services AS s ON p.major_id = s.service_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	s.name

OPEN 
	serviceCursor;

-- Fetch first row with message type permissions
FETCH NEXT FROM 
	serviceCursor
INTO
	@permission_type,
	@permission_name,
	@object_name	

-- Loop through message type permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON SERVICE :: [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		serviceCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name
END

-- Cleanup cursor
CLOSE 
	serviceCursor
DEALLOCATE
	serviceCursor



SELECT
	*
FROM
	@Result

Tuesday, September 11, 2007 11:25:37 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
SQL

Useful change to know about.

In SQL Server 2000 you needed quite some permissions (SS2000: TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable.)

In SQL Server 2005 you're allowed to perform a truncate table as soon as you have 'ALTER' permissions on that table.

Tuesday, September 11, 2007 11:22:26 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
SQL
 Wednesday, September 05, 2007

Somasegar blogs:

I am very pleased to say that we have delivered on that promise and today we announced the release of Silverlight 1.0 as well as Expression Encoder 1.0.  Both are available on the web today! 

Wednesday, September 05, 2007 12:14:43 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WPF
 Thursday, August 23, 2007

Microsoft has created a very cool experimental interface for searching the web, implementing a Silverlight based userinterface on top of Live Search.

Testdrive it at: http://www.tafiti.com

Thursday, August 23, 2007 12:20:33 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1] -
General | WPF
 Wednesday, August 22, 2007

I've just posted a new blog entry on my AOL blog. I think it turned out really cool!

I use Windows Communication Foundation 3.5 (beta 2) to create a service contract, data contract and client channel and then connect to a non WCF, REST based service.

More on: http://dev.aol.com/node/595.

Wednesday, August 22, 2007 1:21:48 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL | C# | WCF

I just installed two new Vista sidebar gadgets:

Visual Studio 2008 Global Launch Wave - this gadget counts down to the launch of VS2008.

SDC 2007 - this gadget counts down to the start of the annual software conference organized by the SDN.

Wednesday, August 22, 2007 1:42:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General | Vista
 Sunday, August 19, 2007

Chris Bowen blogs about the registration of Code Camp 8 being open! A great event for the New England and Maine developers!

Code Camp 8: Rise of the Silverlight Surfer will be held at the Microsoft offices in Waltham, MA on the weekend of September 29th and 30th.  Registration at 8:30 AM, sessions start at 9:00.  As always, it's a completely free event (and you'll probably walk away with some swag as well.)

Sunday, August 19, 2007 7:48:28 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Thursday, August 16, 2007

More excellent news: Omnext will be present as a sponsor at the Gartner ITxpo 2007 in Cannes.
This ITxpo 2007 is designed to help IT and business executives exploit technology to better their business.

Read more: http://www.omnext.net/bedrijf/news/content/gartner_symposium_itxpo_c/index.xml

Thursday, August 16, 2007 3:17:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

Excellent news: Omnext will be present as a sponsor on the 24th and 25th of September at the Gartner Financial Services Technology Summit 2007. Read more: http://www.omnext.net/bedrijf/news/content/gartner_financial_service/index.xml

Thursday, August 16, 2007 3:15:04 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Wednesday, August 15, 2007

Read my AOL post on using XmlDocument to invoke the REST based AOL Video Search here.

Wednesday, August 15, 2007 2:46:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL | C#

My publishing agent, StudioB, has landed me a great job as part the AOL blogging team and the AOL editiorial board. AOL has a number of cool service based API's, like AOL Video Search, AIM, OpenAuth and manu more. I'll be writing articles and blog posts about using these API's in C# and .NET.

I've been given my own blog space on http://dev.aol.com, check it out at: http://dev.aol.com/blog/22109.

Wednesday, August 15, 2007 2:44:54 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL

Microsoft Visual Studio 2005 Team Edition for Database Professionals Power Tools has been released and is available at: http://www.microsoft.com/downloads/details.aspx?FamilyID=da3f11ad-bd54-4eda-b08c-4df84df0d641&displaylang=en

The Microsoft Visual Studio 2005 Team Edition for Database Professionals Power Tools is a set of enhancements and tools that compliment and improve the user experience of Team Edition for Database Professionals.

This release includes 5 new refactoring types, a new dependency viewer, additional data generators and editors, 2 new MSBuild tasks for Schema and Data Compare as well as the introduction of the TSQL Static Code Analysis feature

TSQL Static Code Analysis
• Static Code Analysis - A precursor to the functionality that will be in future versions of VSTS that will allow you to perform Static Code Analysis on T-SQL code.

Refactoring
• “Move Schema” Refactoring - Allows a user to right click on an object and move it to a different but existing schema
• SP Rename Generation - Generate a new script that will contain sp_renames for all rename refactored objects that the user can then execute.
• Wildcard Expansion - Automatically expand the wildcard in a select to the appropriate columns.
• Fully-Qualified Name Support - Automatically inject fully-qualified names when absent in a script
• Refactoring extended to Dataset - Refactor into strongly typed dataset definitions

MSBuild Tasks
• Data / Schema Compare Build Tasks - MSBuild tasks that can generate scripts as if the user had run the Data / Schema compare UI

Schema View
• API Access to Schema View - Insert / Update / Delete to schema View and list schema objects and their associated files

Dependency Tool Window
• Dependency Tree - Show the dependencies ( incoming / outgoing ) for selected schema objects in a new tool window

Miscellaneous Tools
• Script Preprocessor - Expand SQLCMD variables and include files and command line version (sqlspp.exe) & an MSBuild version ( wraps the command line version )

Wednesday, August 15, 2007 5:57:43 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
SQL | Team System
 Friday, August 10, 2007

Big companies, like Amazon and AOL, offering 'Software as a Service' seem to focus on REST more than on SOAP. Having a Microsoft background myself I found this strange... ASP.NET webservices work great, so therefor why not use SOAP?

The number one great thing about REST is the ability to easily test a service by... typing the URL in you browser. This will at least allow you to test the GET operation on your REST service.

Microsoft's number one dude on SOAP, Don Box seems to be moving away from SOAP himself (or is he running?). Below is an abstract of Don's words during Microsoft Tech Summit 07 taken from Ben Galbraith's blog. Read the full item here.

Q: What is the future of REST?

Don: Interesting word that means different things to different people, such as:

1. Get the WSDL and XSD out of my face
2. Get the SOAP out of my face
3. Put the URI in my face
4. Respect GET
5. Embrace PUT and DELETE

“It turns out a lot of the headache people have with Web Services or WS-* is tied to XSD. XSD is more flawed than most technologies that roam the earth. I was on the committee that created it, and that was back when I made my money explaining complicated technologies to people for money, and man, I could hear the cash registers ringing in my ears.”

“Now my job is making things simple, which is unfortunate since I’m stuck with XSD.”

“XSD was a standard-committee driven piece of ####ing crap.”

“If you’re Sun, if you’re Microsoft, if you’re IBM, you can just throw a bunch of engineers in a room and make it all work. Sun is committed to making their stuff interop with WCF with Project Tango. But if you’re Matz, or DHH, or Larry Wall, you’re screwed, because you don’t have time to build out this stack and then make it interoperate.”

Friday, August 10, 2007 7:49:04 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WCF

Googling for some good examples on how to implement a REST style service using WCF does not provide many useful hits. Microsoft seems to not like the acronym REST very well instead using either the term POX (plain old XML) or 'the Web Programming Model' (WPM???).

Anyway Bryan Bell has a pretty decent post showing the very basics of REST/POX/WPM as made available using WCF 3.5.

Read more on: http://hyperthink.net/blog/2007/03/05/HTTPPOX+Programming+Basics.aspx.

Friday, August 10, 2007 6:43:42 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WCF
 Wednesday, August 08, 2007

My cousin Rodie Blomsma has started his own company, specializing in Software Testing.

Go to: www.blomsmasoftwaretesting.nl

Wednesday, August 08, 2007 9:25:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

AOL just released a cool gadget for the Vista sidebar.

It's still in beta and 'hangs' every now and again. This does not affect the rest of Vista though and all other gadget keep running too.
Download at: http://dev.aol.com/video_gadget.

Main annoyance so far is that in Medium mode it tries to show how long ago the video was posted, but this takes most of the space in the subtitle bar. This can be changed by going to the preference page and changing the settings for Playback size to 'Large'. The subtitles now scroll.

Update: The hanging occurs when the AOL video service cannot be reached.

 

Wednesday, August 08, 2007 9:18:27 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
AOL
Can't wait for the new DB Pro Power Tools to become available!

Wednesday, August 08, 2007 6:16:58 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
SQL | Team System
About
This blog is run by Mark Blomsma.
© Copyright 2008
Develop-One
Sign In
Statistics
Total Posts: 323
This Year: 67
This Month: 0
This Week: 0
Comments: 89
All Content © 2008, Develop-One
DasBlog theme 'Business' created by Christoph De Baene (delarou)