/// Frank Hagen: Professional Web Developer, C# User, Reformed Über-geek RSS 2.0
# Wednesday, October 08, 2008

Here we go again.  As mentioned previously, I have finally purchased real hosting.  With my own domain name, I am finally fully managing my blog.  I am going to use DasBlog again, like in the old days of running it on my home server.  It's not as clean (yet) as WordPress, but it is much, much more configurable.

Let's see how long this run lasts.  Ironically, I am able to finally post almost all of my old content again.  The only posts missing are the really old ones from when I was crafting it with JavaScript and DHTML.  Maybe I will get those in one day too.

Wednesday, October 08, 2008 3:53:22 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Blog
# Tuesday, September 02, 2008

Well, the new domain is finally up.  FWHagen.com if you want to see it, but there is nothing there yet.  I purchased the hosting account 2 weeks ago and have yet to have the domain name properly transferred to the provider. 

Many years ago, I decided I wanted to have FWHagen.com for myself, for professional development and personal/family use.  I took a chance on the upstart company GoDaddy when they started out because they were pretty cheap.  I was very pleased with their service, having dealt with Network Solutions for years before at work.  That is until this past week, when I tried to transfer it.  After waiting for several days, I discovered that the account was "locked" to prevent any accidental or unauthorized transfers.  If you have ever transferred a domain before, you know that is a bunch of crap.  I had to personally authorize the transfer, so why the lock?  Because of the subsequent failure to transfer, I have to wait 60 days to try again.  The waiting period is ICANN specified, and I really don't have any logical problems with that, except that GoDaddy now gets to hold it for another 2 months. 

I was able to forward the DNS records over, so it works for now.  And I have a long time left to get the domain settled, as well.  It is just very frustrating to deal with underhanded greed like that.  For the sum of $10/year. 

UPDATE [19:50]:  I was wrong about GoDaddy.com.  On my way home this evening, I got a call directly from them expressing concern about my problems.  Now, here's the thing, I only posted my concerns here.  They took the initiative to track me down and fix the problem.  Well, tracking me down in the sense that I posted my domain name and they called my contact info, which only they have.  Long story short:  I am so impressed with their commitment to personal service that I am cancelling the transfer and will simply use DNS forwarding for my new site, as it works perfectly well.  I will continue to use them as my registrar and will definitely use them in the future whenever I can.  BTW, the 60-day wait is ONLY for sucessful transfers.  It does not apply to failed due to locks or privacy safeguards.  And the $10/yr jab?  Only heightens my impression of them.  They surely spent more than that in time and effort on one measely IT guy's satisfaction.

Tuesday, September 02, 2008 7:55:13 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Blog | Rant
# Thursday, August 21, 2008

I hate seeing a solitary "1" on the bottom of a paged datagrid because the dataset is too short to have more than one page.  You don't really want to turn off paging but suppress the "1" when it is not needed.

Use this code to do just that when binding the grid:

        if (dgEmployee.Items.Count < dgEmployee.PageSize)
            dgEmployee.PagerStyle.Visible = false;
Thursday, August 21, 2008 11:32:25 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
.NET

I've had it with Cox Cable.  I tried to put up a photo album (all HTML, because they have never allowed scripting) last night, and was informed that my personal webspace exceeded the size limit.  After some digging, I found that they impose a 10MB limit on personal sites.  Their technical support people really dropped the ball there too, cause I could have been sold an upgrade to allow for my home server to publish, but no, that would be too much to ask.  I swear:  the day FiOS is available in my area, I am switching.

So I finally broke down and selected a paid host.  All of my personal and professional hosting will be done from, well, a highly regarded and recommended vendor. 

I will be moving this site to it as well sometime in the future.  Wordpress is very nice, but they will nickel and dime you to death for any customizable features (which is why this site looks so bad) and domain assignments.  Yes, I own a domain and have for years.  It's time to finally put it to use.

Thursday, August 21, 2008 9:33:19 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Blog
# Wednesday, July 23, 2008
Here's an extremely useful stub to get data from SQL-Server within a PowerShell script:
$TaskName = "20071029-AllRejectedDuring"
$SqlServer = "SQLDEV01";
$SqlCatalog = "MyData";

# Get the T-SQL Query from .SQL file
$SqlQuery = Get-Content (".\" + $TaskName + ".sql")

#Write-Host ($SqlQuery) -foregroundcolor "gray"

# Setup SQL Connection
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = 
          "Server = $SqlServer; Database = $SqlCatalog; Integrated Security = True"

# Setup SQL Command
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection

# Setup .NET SQLAdapter to execute and fill .NET Dataset
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet

#Execute and Get Row Count
$nRecs = $SqlAdapter.Fill($DataSet)

Write-Host ($nRecs.ToString() + " Records retrieved.") -foregroundcolor "Cyan"
$SqlConnection.Close();

if ($nRecs -gt 0)
{
  # Do Stuff
  $DataSet.Tables[0].Rows[0][0]  #Print first data element
}
The connection is using Integrated Security for simplicity, it wouldn't be difficult to switch to UID/PWD instead.  Also, I put the SQL in a .sql file (flat text) to make life easier; you could also put the statement in the string declaration, if it is a simple query.  PowerShell's Get-Content mechanism makes reading a file very easy.  Also, clean up after yourself, I won't include that here. UPDATE:  I have posted a full script to export to Excel or XML in a followup post.
Wednesday, July 23, 2008 10:55:30 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
PowerShell | SQL

Earlier, I wrote about getting data from MS-SQL with PowerShell, which is a very useful and powerful thing.  But just displaying data is very limited.  I have a need at work to create extract "reports" for business owners frequently into Excel.  So I have leverage this scripting technique to do the legwork for me.  After many iterations, I have completed the first version of a script that will take a SQL query in a text file and create an Excel file with the results.  All fully automated with time-stamping, archiving of the successful query, and the ability to export XML or CSV as well.

The script is unfortunately only listed as a page on this site because WordPress does not allow posting of non-media files.  You will have to copy the full content and paste it into a text file named QuerySQL.ps1.  One day, I will host this weblog on a real provider in order to have better control (I will accept donations!).  If many folks prefer, I will post it on my personal webspace with my ISP and provide links on request.  And maybe to CodeProject too.

Feel free to use it in anyway you wish.  Please learn from it if you can, or conversely, send me a note on how to improve it.  I would love to get the field-name bolding working among other things.

Wednesday, July 23, 2008 10:29:00 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
PowerShell | SQL
# Friday, July 18, 2008

Heralded by many to be one of the founding series of modern science fiction, this is the first book of the Lensmen series.  It has been made into games, TV shows, etc, none of which I am familiar with.  So, I thought I'd better get with it and do so.  I picked up an old dime-store copy and got reading.

Triplanetary seems to be a collection of early stories and a novella that sets the stage for the series to come.  The first few stories tell of the fall of Atlantis, the burning of Rome, WWI and WWII, etc.; important events in human history.  They expose an galactic plot between two superpowers at war with one another, although one doesn't know of the others existence, in which Earth and its inhabitants are unknowing pawns.  The final novella is about 3 Terrans captured by space pirates, escape, then by a vastly advance fish alien civilization, which, of course, are able to escape from again.  Fortunately, Terran military scientists are able to quickly reverse engineer the fish alien's vastly superior technology in only a few weeks (days?), and built a super-battleship capable of defeating the aliens very civilization.

Yes, this is early sci-fi.  Pulp fiction, et al.  And I probably would offend the leet geeks, but I thought this book was terrible.  Maybe this was a fan-service book to set the series, but I felt the characters were flat and trite; I didn't care what happened to them at all.  The swooning girl, the incredibly capable hero with a tender spot for our frail damsel, the military leaders with single-minded faith in our hero to the point of having no contingencies, all make for great plot indeed.  Maybe I have been led to expect too much, but Burroughs, Howard, Asimov, Clarke and the others have done so, and in surrounding time frames.  So, I won't find out if the rest of the series is any good.  I just don't care.  Indeed, I can't even be bothered to find cover art for this post.

Friday, July 18, 2008 10:49:02 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Books
# Sunday, June 15, 2008

Dale BrownRecommended by another of my ex-Navy friends, I have just completed my 3rd read of this book.  I first read it in 1996, and have considered it one of the most important books I have ever read.  I love combat books written from the point of view of the man in the trenches; this is the one that started it all.  I prize my copy so highly that I will not lend it to anyone.

Company Commander is the experiences of Captain Charles MacDonald, US Army, from the fighting at the Siegfried Line to the end of fighting of World War II.  He is put in command of I Company as a replacement for the previous CO killed during their last engagement.  His baptism of fire during the Wehrmacht's last offensive at the battlements is a stunning introduction to the front.  Mac works us through his fears and nervousness as a new commander and gives us witness to the elation of survival in the trenches.

This book is one of the most memorable I have read about combat infantrymen in WWII.  I dare say it may be one of the most important I have ever read.  Although I have no way of knowing its accuracy, I suspect that the frank portrayal of the front-line infantryman is the reason for the gripping read.  Ironically, he has also captured the long stretches of boredom followed by the frantic moments of utter panic.  Yet the slow areas are more a relief than they are dull passages.  The only complaint I might have is the near complete absence of any technologic detail of the weaponry used, although that is more than made up for by the detailed analysis of the order of battle used during the conflict.  If you have any interest in infantry combat in WWII, this is a must-read book.

Sunday, June 15, 2008 9:18:34 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Books
<%--
--%>
Statistics
Total Posts: 186
This Year: 0
This Month: 0
This Week: 0
Comments: 72
Locations of visitors to this page
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Frank W Hagen
Sign In
All Content © 2010, Frank W Hagen
Custom DasBlog theme based on 'Business' by Christoph De Baene