Category Archives: IT
SQL Server: Find tables containing column name
To find all the user tables that contain a particular column name run the following command on the relevant database:
SELECT name FROM sysobjects WHERE xtype='U' and id IN( SELECT id FROM syscolumns
WHERE name like '%COLUMN NAME%' )
Developer Workshop: MVC and Visual Studio 2010
I had the pleasure of attending a workshop by Scott Guthrie this week where he discussed the MVC (Model, View, Controller) design pattern within asp.net and the new additions to the .net framework coming with the release of C# 4.0 and Visual Studio 2010.
The first session on MVC raced by and before anyone in the audience had noticed two hours had passed by. The content was aimed at people who had never seen the MVC pattern before and brought us from a brief definition through to creating a full website. One of the highlights of this pattern for me was the ability to fully control the html output of the site as well as applying validation to the Model layer of the site and having that carry through to all aspects of the application including client side validation.
The second session focused on the soon to be released .net 4.0 framework and Visual Studio 2010. There are a lot of really interesting features being released not least the inclusion of jquery and a lot of editor improvements. An audible gasp went up from the audience when Scott demoed a new multiline selection and editing feature.
Overall it was a fantastic workshop to hear of new approaches to application development and something that I believe we will hear a lot more of..
The two sessions were videoed and I believe will be available from the Channel 9 website soon. In the meantime here’s videos from the Netherlands branch of the tour:
http://channel9.msdn.com/posts/matthijs/Scott-Guthrie-ASPNET-MVC-2/
http://channel9.msdn.com/posts/matthijs/Scott-Guthrie-Visual-Studio-2010-and-NET-Framework-40/
K2 Blackpearl: Goto Activity
When Goto doesn’t go when you want it to
When working with server side events I have found it common to reroute the workflow to a different activity within the workflow. Perhaps a user has decided to end the workflow and I want to send them to an End Workflow activity first. I would normally use the following code to do this:
K2.GotoActivity("NameOfActivity");
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }However to my surprise instead of the workflow moving to straight to that activity what actually happens is that the pointer linking the end of the current activity to the next changes to point to the activity entered in the GotoActivity code above. This means that if you have additional server events and potentially client events within the activity listed below the code containing the Goto they will still be processed leading to all sorts of errors further down the line.
The solution for me was to set a flag once the Goto had been called to skip out any further code execution. Messy but safer than allowing the code to execute. One to watch out for in your own code.
K2 Mail Event Hyperlinks
I had a situation where I needed to email a user from within the workflow process using a mail event with a dynamically built url generated from a stringtable entry detailing the start of a url and a datafield value containing a reference id in the email body. I found that no matter what way I concatenated the two values together or added href anchor tags to the body of the email, the email would be received showing the link but without it formatting itself as a hyperlink.
The resolution to this was to concatenate the values together along with the html tags in a server side code event and store this value in a datafield before the mail event item was reached.
The code ended up being:
K2.ProcessInstance.DataFields["Hyperlink"].Value = string.Format("<a href="{0}{1}">{0}{1}</a>", K2.StringTable["UrlString"], K2.ProcessInstance.DataFields["Identifier"].Value);
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
Hope this helps someone else out there.
4 Weeks, 2 IT Conferences- April’s going to be busy
DeveloperDeveloperDeveloper Belfast- 4th April
DeveloperDeveloperDeveloper! Day – Belfast- Saturday April 4th 2009! This FREE developer event brings DDD to Belfast! If you were unable to go to Microsoft TechEd, Microsoft PDC or conferences such as DevWeek, DDD is for you! There will be NO Microsoft speakers presenting, just speakers from the .NET developer community; although we will have many of the Irish Developer Platform Evangelists (DPEs) on hand to help out and chat to attendees.The day is put together by the community for the community, in other words you. We thank our sponsors who have helped make the event possible: Microsoft have graciously sponsored the event!
More information and registration at: http://www.developerdeveloperdeveloper.com/belfast
Agenda
—————————————————————————————————-
Barcamp- 25th April
BarCamp Belfast is a user-generated unconference for designers, developers, startups and geeks to share and learn in an open environment. It’s taking place on the 25th April 2009 in The Black Box, Belfast.
Speakers- More to come
Teens & T’Internet — How to understand and deal with Under 18s on the internet, how to market to them etc. (not to be taken seriously!)
— Enda Crowley (@endac)
What’s your phone number? — A talk about social networks, social engineering, simplicity, and grassroots action.
— Blaine Cook (@blaine)
Something about WordPress — Something about using WordPress
— Lee Munroe (@leemunroe)
MySQL Replication — Scaling your app using MySQL replication for redundancy & capacity . Replication Topology, sever roles, hints, tricks, tips & gotchas.
— Simon McCartney (@simonmcc)
Niche Social Networks — How to Make Millions (or maybe just a living…) from a Niche Social Network.
— Michelle Gallen (@michellegallen)
Not sure yet — Probably my microcontroller modded, with wifi frankenstein coffee roaster
— Andrew Gribben (@grib)
MatchMedia — An insight into ‘The Digital Visualisation of Competitive Sport’ a product currently in development. Philip Wilson (the products inventor) will give a view of the product, the progress being made, the partners already involved and any potential collaboration opportunities.
— Philip Wilson (@internetsense)
Engaging In Social Media — How brands are using social media (in particular Bebo) to engage with their audience
— Philip Macartney (@fubar7676)
Competitive advantage and the web — How what makes companies is changing, and what this means for you!
— Paul McKeever (@paulmckeever)
Adventures in building a web app — Short talk on experiences building a real time Javascript app atop Google AppEngine, and/or focus on application performance and why it’s of prime importance.
— David Wilson
Educating Standards — Bootstrapping web design education for the benefits of the creative community by creatively colliding the ivory towers of academia with the messy trenches of industry.
— Christopher Murphy (@fehler)
More information and registration: http://www.barcampbelfast.com/
K2 Blackpearl Error: 1 28025 Failed to Start IPC
I got hit with this error last week when an IPC event that I was using within my workflow to kick off another workflow process failed to start. It turns out that I had forgotten to give my child process start permissions within the K2 server. As soon as I did this it started working for me.
It seems like such a small error but took way too long to find a solution as there was only a couple of forum posts with the same error as me but without a solution so I can’t be the only one out there having problems with it. Here’s hoping that the next person with the error will stumble across this post rather than searching in vain.
NIMTUG last night
Last night as previously mentioned I attended the Best of PDC event hosted by NIMTUG at the Welly Park Hotel. It was the first nimtug event since April and it was great to see so many people there, especially those well remembered from previous events. As is by now tradition we stayed for a good while once Martha’s excellent talk had finished, discussing the current IT situation in Belfast and I ended up back home at 1am this morning. Well worth it though and a huge thank you to Martha, Damien and Simon for putting the event together.
NIMTUG:Best of PDC Event
The Northern Ireland Technology Users Group, or NIMTUG for short, are holding its next event on Monday 1st Decemeber in the Wellington Park hotel in Belfast. The session will cover a range of topics from LA’s PDC event earlier this year. Further details and registration can be found on the nimtug site.