Monday, December 15, 2008

My golden parachute had a hole in it

Unfortunately, I've become (or more correctly, will become) a statistic at the end of December as my 9 year tenure with UBS / Salvagno Partners fell a year short. I'm not surprised given the state of the economy and more specifically, the state of the financial sector. That said, I'm confident I'll be able to find new employment given my experience. My only concern is that potential employers will see that I've only had one job and somehow making the assumption that I don't have enough experience.

I can't discount that in today's technology job market mindset, but I believe I have a lot more to offer than someone who has bounced from job to job, being told how to do their job. My experiences include meeting clients face-to-face, analyzing what they were truly asking for, designing an application to fit those needs, developing that application and then deploying it (and supporting it). Talk about the full software development lifecycle. Not only were those some of my roles, but I was also only able to work with limited resources (mostly interns), so I had to manage these projects with assets that were constantly coming and going.

What are your thoughts? Do I have a valid argument about my experience? How would you respond to an interview if you were asked about your experience (level) due to having a single employer for 9 years?

If any potential employers are reading this, my resume and some examples of my work can be found here.

- Brandon

Monday, April 21, 2008

Templated User Controls

I just wanted to get this down while it's still fresh in my mind, and hopefully it will help someone else out if they run into the same problem ... Ok, so I created a template user control (called "SidePanelContainer") with the only intention for it to be a formatting thing (basically a bunch of nested divs to create a border, a title and whether to show a close button). Inside the template can go other user controls, web controls, etc. In this instance, I was adding another user control into this templated user control. So it looked something like this in the aspx page ...



<uc1 : sidepanel id='Sidepanel1' runat='server' headertext='HEADER TEXT'>
<sidepaneltemplate>
<uc2>MY DATA USER CONTROL</uc2>
</sidepaneltemplate>
</uc1 : sidepanel>


Upon postback, I was losing the information in the child user control (uc2). To make a lot of code short, I had a Page_Load method in my SidePanelContainer user control that called the DataBind() method. Looking back, that was unnecessary, and it was the source of frustration since my internal user control would rebind each time. I don't know if this will effect actual databound controls, but that's for another day.

Wednesday, February 13, 2008

.NET Remoting in non-domain enviroments

Wow, talk about a hair puller ... I hope this helps someone working on a .NET application where they need to communicate in a domain-less or workgroup situation. Basically my application is run on almost strictly Windows XP machines, but the user can choose to make their application the "server", thus starting a TCPServerChannel.



Server Code --------------

if(makeMeAServer) 
{
RemotingConfiguration.Configure("config file", true);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(SomeRemoteableObject), "SomeMethod", WellKnownObjectMode.SingleCall);
}


Server Config File ------------

<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" secure="true" protectionlevel="EncryptAndSign" port="8080">
<serverproviders>
<formatter ref="binary">
</formatter>
</serverproviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
Thanks to .NET 2.0, the TCP channel can be secured, but the gotcha I ran into was that I couldn't authenticate the client (call it "WinXP Client") using a TCPClientChannel with the newly created server (call it "WinXP Server") in a workgroup enviroment.

Obviously this was because of a credentials issue. "No problem" I thought, I'll just add a new user who is valid on "WinXP Server" to "WinXP Client" with the same name and password. Pretty standard stuff to get NTLM to kick in. Guess what, it still didn't work!

WTF mate?



To make a long story short, after spending quite a bit of time on various seach engines and forums, it all boiled down to the fact that Windows XP has "Use simple file sharing (Recommended)" enabled by default for workgroup computers (maybe domained ones as well?). After I unchecked this option (Tools -> Folder Options -> View), it worked like a champ. I need to go back and see if passing username, password and domain(i.e. machine name) as parameters to the TCPClientChannel will work, but that's not necessary at the moment for me.

BTW, here is the client side config file and necessary code ...



Client Config File -----------------

<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" secure="true" impersonationlevel="Impersonation" protectionlevel="EncryptAndSign">
<clientproviders>
<formatter ref="binary" typefilterlevel="Full">
</formatter>
<serverproviders>
<formatter ref="binary" typefilterlevel="Full">
</formatter>
</serverproviders>
</clientproviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
Client Code -----------

RemotingConfiguration.Configure("Client.exe.config", true);
SomeRemoteableObject test = (SomeRemoteableObject )Activator.GetObject(typeof(SomeRemoteableObject), "tcp://remoteserver:8080/SomeMethod");
Console.WriteLine(test.LastNameOrWhateverProperty);

Friday, February 1, 2008

Some T-SQL help

This is mostly for my reference, but it might help someone else...

I needed to compile some information into an Excel spreadsheet from the main SQL DB. I needed one of the columns returned to be a concatenated value of a resultset.



For example, I wanted the end result to look like:



Column 1 Column 2

--------- ---------

Client A Account1, Account2, Account3



The normal result would have looked like:



Column 1 Column 2

--------- ---------

Client A Account1

Client A Account2

Client A Account3



After chasing around a few options, I ended up using a SQL function that took in the Client and using COALESCE + a variable, pulled the accounts into one varchar.

The function ended up looking like the following:

alter function fn_accountsforclient(@id int) returns varchar(8000) as 
begin
declare @returnVal varchar(8000)
select @returnVal = coalesce(@returnVal + ', ' + a.account, a.account)
from ACCOUNTS a
where a.clientID=@id
return @returnVal
I'm just wondering if there was another way using straight SQL Select statements (i.e could have been executed from Excel's DB Query) instead of using a function? Since T-SQL is not my main programming focus, I know I am seriously lacking at more efficient ways of doing things.

Thursday, January 24, 2008

Typed datasets are good ... in small quantities

Today I had to throw together an app that would allow a fine grain comparison (i.e. more control than VLOOKUP) of values between an Excel spreadsheet and a SQL Server. Pretty standard stuff I know, but this was my first pass at doing so using typed datasets for the SQL end (I like compile time checking), and pretty much datasets in general. I'm more of a Business Objects type of guy.

I have to say, it was actually really easy to use. The only thing holding me back from using them more often in my full scale app is the separation factor of the DAL from the BLL and not having a circluar reference. I typically use 3 classes: An object class (which is really just a dummy set of classes containing class properties), Data Access Class and a Business Logic class. I think it's possible to separate the typed dataset from the table adapters, but it wasn't something that's easily discerned/apparent. Plus with LINQ to SQL ...

Just for my reference ... to add a datarow from one datatable to another, use DataTable.ImportRow(datarow);

Wednesday, January 23, 2008

First Post

Well, this is my first blogging post. We'll see if it works out like it's suppose to. Hopefully I'll keep this up as I really enjoy reading other people's blogs for ideas or laughs. For tonight though, I'm gonna keep it short.