Tech Blog

Jay's Technical blog

DataSet discussion revisited...

28 May 2004
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I want to revisit a discussion that I had early on in my blog - Datasets.

After several months of heavy development (actually a conversion of some ASP code that I have been maintaining), I have found that I don't use the dataset.

Maybe it's the advice that I've been getting or maybe it's the result of my design.  FWIW, here's what my stuff looks like (in VB):

' The following class will handle all the SQL Calls for an area of the site
Class sqlPortionOfSite
inherits sqlBaseClass
Public Function GetData() as CollectionOfMyData
  Dim __dr as sqlDataReader
  Dim __Rtn as CollectionOfMyData

  __Rtn = New CollectionOfMyData()

    __dr = sqlHelper.ExecuteDataReader(ConnString, storedproc, "MySP") '   I use the Data Application Block

      Dim __Data as MyData = New MyData 
      __Data.Field1 = __Dr.GetInteger(__Dr.getOrdinal("Field1")) 
      __Data.Field2 = __Dr.GetString(__Dr.getOrdinal("Field2")) 
    End While

    Return __Rtn

    If Not(__Dr is Nothing) AndAlso __Dr.isClosed() = false then __Dr.Close 
  End Try

End Class

So in this case I would have a class called MyData

Class MyData
  Protected _Field1 as Integer
  Public Property Field1 as Integer
       Return _Field1
    End Get

    Set (Value As Integer)
       _Field1 = Value
    End Set
  End Property

  Protected _Field2 as String
  Public Property Field2 as String
       Return _Field2
    End Get

    Set (Value As Integer)
       _Field1 = Value
    End Set
  End Property
End Class

and a collection class called CollectionOfMyData (which is way more complicated than I really want to document here... suffice to say start with a CollectionBase (or if Rob would publish his Collections there would be something even better). 

I really like this method because I can easily pass around the individual row all over the place (in session, viewstate as well as in a list) and the resulting object is fairly light weight.  When it comes to sorting (which was my problem before), I use Rob Teixeira's collection classes that he built here at work (I really wish he would release them); they have some built in methods for easily getting sorting/filtering to work.

The other thing you may notice is that I have separated my data access from the main part of the program (I actually have these classes in another project all together)... it forces me to do more work if a need to add a new field, but more than likely I would have to do something to display the field anyway.  The other thing is that if there is a problem with the communication with the database, I know exactly where in the code the problem is.

OpenVPN... a cool open source tool

27 May 2004
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

I just discovered a pretty cool open source product last night -- OpenVPN.  Here's my question (up front).  Does anyone know of any security holes in it (I couldn't find any, but it may be too new)?  I know that it relies on OpenSSL (I think mainly for key generation, but I'm not sure)

If you don't know, it is a pretty easy to setup VPN software (I know that there are MS Networking Gurus out there saying “What's wrong with you man?   Just create a windows VPN.  It's all simply  a matter of going into Routing applet in the control panel, and adding 10 routes to various places, you'll need to configure the whosiwhatsis, and then blah blah blah and uh waa uh waa uh waa... and then your done.”  Since I've not seen a guide written in simple English that says “Here's how to configure Win2k or Win2k3 to do VPN routing between 2 machines (followed by a simple discussion of what to do to so that 1 party can see the rest of the network), I have been looking for a simple way to connect 2 machines (and then the network part).

As you may or may not know, by day I work for a Company that see itself as a major corporation.  By night I have a consulting business with my best friend Dave Balzer (who does this both day and night).  The problem that we have is that he lives in Ohio and I live in Florida.  We have wanted to connect our 2 networks so I could (for instance) utilize his SQL Server instead of using my own and then scripting the changes out and putting them into his instance... transfer of data is such a pain...

I got OpenVPN to work on the 2nd try!  So here's the deal if someone wants to set it up on Windows.  The instructions on the OpenVPN site are great, but they are disorganized!

Here's what I did last night: I followed the instructions in the “Example running a point-to-point VPN” section which is about 1/4 of the way down the documentation (ignore the section that says “How to Install”  Simply run the installation EXE and then skip down to the “Example running a point-to-point VPN” section).  I was able to have it running in about 1/2 hour (probably could have done it in less time... read on).  Very cool.  Oh yeah, make sure you mix things up a bit (change the port being used, etc.)

BTW, to save you some headaches.  There is an issue with WinXP Sp2 (I'm running the release candidate at home).  Download the latest release for windows (which is not version 1.6, but is 2.0Beta2).  The link to it is on the home page among the links in the upper left hand corner.

Anyway, I'm curious if anyone can give me a reason, why I should not use this?  I want to know of any holes that might be in the product as it works great!  I found it while trying to use OpenSSH to give me a tunnel to the SQL Server port.

Rory - An Apology!

25 May 2004
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

Ok, I just saw some comments over inRory's blogthat bugs me (and so I have to blog about it).  So on that note:

Rory, I want to apologize for every callous idiotic attempt that every Christian has ever made at trying to “reach“ you; I want to apologize for all the stupid arguments/attacks that many Christians think will cause you to move to our point of view; I also want to apologize for our lack of an attempt to know you and love you where you are at (and not try to change where you're at; but let you make your own decisions, even if we think they are the wrong ones).

I say all this for one reason; because I know what it is like to be attacked by religious zealots -- both as a non-Christian, and as a non-Muslim. 

I understand that Christian zealots are the reason why people like my former colleague Ken Courtney (check out this post here) is such a “militant” atheist (BTW, militant is my term not Ken's) and really feels that he has to war with Christianity and religion in general.  There's a bigger picture, Christians!  We must never forget people's feelings... Jesus is not a used car that you try to convince someone to buy into.

Roy Oshoreve...

21 May 2004
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

is an OK guy.  I guess I never realized that Roy had different original date in mind... I was only paying attention to the due date.

Roy changed the deadline back (ok, it was never meant to be June in Roy's mind), to June 30th!  Woohoo! Thank you... Sorry for creating the fuss... I had simply slowed down development a little when I thought the deadline was in June (instead of May).

Anyway, (as they used to say on the playground) no harm no foul...

Mike Schinkel is a credit to the community...

21 May 2004
Jay Kimble

[WARNING! This is an archived post and as such there may be things broken/missing here.. you have been warned.]

As some of you may be aware, Mike Schinkel (Of Xtras.Net), have been (fumbling for the proper word... acquaintances is too weak... we know each other... friends is a little strong... hmmm)... Ok, we've known each other for a little bit.  For awhile we were fierce competitors, the company I worked for came into the VB market.  I've always been interested in components and their development, so someone like Mike has always been a contact I could never let get too far out of reach. 

Mike posted over on his blog the history of his company (you can read my part in this history here).  Instead of posting a comment I wanted to pull back the curtain a little. (BTW, Mike, you should probably have a link on Xtras.Net somewhere that makes it easy for me to find your blog...) 

Mike and I have been talking the last couple of weeks (My review of Palo's product came as the end result).  I really want to see the component arena explode.  And since I like components. I want to play with as many as I can (good ones, bad ones, I don't care... I like tools). 

So anyway, the coolest thing about my review idea (which has always been my idea... we review books in blogs why not components and tools?) was that Mike Schinkel was insistent that if I do it that I remain honest about what happened good and bad.  I couldn't believe it!?!!  Someone who markets tools (really that's what the catalog is all about) is telling me to be honest.  If I don't like something say it; that way the vendor may fix the issue.  Mike and I were talking because I know him and I knew someone could benefit from this activity (Mike is at the top of my list... after the honesty conversation, he is not dropping off the list for awhile).


So the point of my post
<Jay's Sales Pitch>We need to convince our companies to start buying from Xtras (if you're looking for a better price than retail go to Xtras.Net), they care about our community, and we should support them.</Jay's Sales Pitch>
If you're not convinced of this then read Palo's comments to Mike's blog entry (and see Mike's response).