Welcome to AddressOf.com Sign in | Help

Twitpic Updates

Twitter Updates

Travel

Advertisment

 
Blog
  • Touring through Northwest Arkansas

    I'll be leaving either tonight or tomorrow morning (really early) to start heading to Fort Smith, AR. Tuesday evening will be in Springdale, AR and finishing up Thursday evening in Harrison, AR.

    If you are in the area of *all* three user group, consider attending all three since each group will host a different topic.

    LINQ - An Average Joe's Guide (or "It's not all about SQL")
    Fort Smith .NET User Group (Fort Smith, AR)
    September 14th, 2009 - 6:00pm

    ClickOnce - The Good, The Bad and The Ugly
    Northwest Arkansas .NET User Group (Springdale, AR)
    September 15th, 2009 - 5:30pm

    Comparing WinForms to WPF
    Ozark .NET User Group (Harrison, AR)
    September 17th, 2009 - 6:00pm

    As always, look forward to a heathly dose of conversation (not presentation). 

    It's looking like it will be raining all the way through Wednesday. :-(  Bad for motorcycling, but might be good for you.  If you are in the area and would like to get together, contact me and we'll see what we can do. 

  • WinForms ComboBox -> DevExpress ComboBoxEdit (migration)

    I found a couple of solutions on the DevExpress website for how to use the ComboBoxEdit component the way I wanted, however, none of them seemed to provide a smooth transition from the WinForms databound ComboBox to the DevExpress counterpart.  So using some fo the examples that I found, reading through the help and reflecting on the subject for a whole five minutes... here is what I ended up with.

    Option Explicit On

    Option Strict On

    Option Infer On

     

    Imports System.ComponentModel

     

    <ProvideProperty("DisplayMember", GetType(Control))> _

    <ProvideProperty("ValueMember", GetType(Control))> _

    <ProvideProperty("DataSource", GetType(Control))> _

    Public Class ComboBoxEditEx

      Inherits DevExpress.XtraEditors.ComboBoxEdit

     

      Private m_valueMember As String

      Private m_displayMember As String

     

      <Category("Data")> _

      <Description("Indicate the property to display for the items in this control.")> _

      Public Property DisplayMember() As String

        Get

          Return m_displayMember

        End Get

        Set(ByVal value As String)

          m_displayMember = value

        End Set

      End Property

     

      <Category("Data")> _

      <Description("Indicates the property to use as the actual value for the items in the control.")> _

      Public Property ValueMember() As String

        Get

          Return m_valueMember

        End Get

        Set(ByVal value As String)

          m_valueMember = value

        End Set

      End Property

     

      <Category("Data")> _

      <Description("Indicates the list that this control will use to get its items.")> _

      Public WriteOnly Property DataSource() As DataTable

        Set(ByVal value As DataTable)

          Dim item As New ComboItem(Me.ValueMember, Me.DisplayMember)

          item.SetDataSource(Me, value)

        End Set

      End Property

     

      <Browsable(False)> _

      Public Property SelectedValue() As Object

        Get

          Dim item As New ComboItem(ValueMember, DisplayMember)

          Return item.GetItemValue(Me)

        End Get

        Set(ByVal value As Object)

          Dim item As New ComboItem(Me.ValueMember, Me.DisplayMember)

          item.SelectItem(Me, value)

        End Set

      End Property

     

      <Browsable(False)> _

      Public ReadOnly Property Items() As DevExpress.XtraEditors.Controls.ComboBoxItemCollection

        Get

          Return Me.Properties.Items

        End Get

      End Property

     

    End Class

     

    Friend Class ComboItem

     

      Private m_value As Object

      Private m_displayText As String

     

      Friend Sub New(ByVal valueMember As Object, ByVal displayMember As String)

        m_value = valueMember

        m_displayText = displayMember

      End Sub

     

      Public Overrides Function ToString() As String

        Return m_displayText

      End Function

     

      Friend ReadOnly Property Value() As Object

        Get

          Return m_value

        End Get

      End Property

     

      Friend Sub SetDataSource(ByRef control As ComboBoxEditEx, ByVal dt As DataTable)

     

        For Each row As DataRow In dt.Rows

          Dim item As ComboItem = New ComboItem(row.Item(control.ValueMember), CStr(row.Item(control.DisplayMember)))

          control.Properties.Items.Add(item)

        Next

     

      End Sub

     

      Friend Function GetItemValue(ByRef control As ComboBoxEditEx) As Object

        Dim item As ComboItem = TryCast(control.SelectedItem, ComboItem)

        If item Is Nothing Then

          Return Nothing

        Else

          Return item.Value

        End If

      End Function

     

      Friend Sub SelectItem(ByRef control As ComboBoxEditEx, ByVal value As Object)

     

        Dim index As Integer = 0

     

        For Each obj As Object In control.Properties.Items

          Dim item As ComboItem = TryCast(obj, ComboItem)

          If item IsNot Nothing AndAlso _

             item.Value.Equals(value) Then

            Exit For

          Else

            index += 1

          End If

        Next

     

        If index >= control.Properties.Items.Count Then

          control.SelectedIndex = -1

        Else

          control.SelectedIndex = index

        End If

     

      End Sub

     

    End Class

    The overall goal was to provide a seemless transition (read: drop in replacement) for the comboboxes I already had on existing forms to migrate to use all devexpress controls since I wanted to take advantage of the skinning tech in XtraForm.  So what I needed was an easy way to take the existing datatables I had bound to WinForms ComboBox's, the code already used to assign (SelectedValue and SelectedIndex depending on circumstances).  So far this has worked out pretty nicely.  If you are in the same situation... here you go...

    07-29-2009, 6:46 AM by CorySmith to AddressOf.com
  • The *new* Star Trek

    Before seeing the movie, back when information regarding some of the story elements starting coming out, I was extremely concerned regarding the inclusion of yet another "temporal anomaly" being used to spark the story line.  It's not that Star Trek hasn't had time travel elements in there from the beginning, it's just that this usually ends up as a crux because they seem to haven't been able to figure out something better to do so "hey, let's do another time travel episode".  Anyway, after seeing the movie, this was pure genius in this case because it helped to spark real separation between the old and the new.  All of the characters have their basic personalities in place; however, because of the way the overall story was put together, everything can evolve in a much different direction.  I don't want to give anything away, but if you haven't been interested in seeing the "new" Star Trek because of any thoughts regarding departure from the "old"; do yourself a favor and go watch the movie.  This is, by far, one of the best Star Trek movies... I'd be willing to say that it is *the best* Star Trek movie because they are able to gather a group of young actors and prep them to "boldly going where no one has gone before" for many years to come.  I very much look forward to the next Star Trek movie!

    05-14-2009, 9:08 AM by CorySmith to AddressOf.com
  • San Diego ASP.NET SIG - May 19th, 6pm

    I'll be at the San Diego ASP.NET SIG on May 19th doing my LINQ in the Real World discussion.  For anyone that has been at my previous "presentations", you'll know that I prefer to have more of a discussion surrounding the topic than a lecture.  So if you're in the area and would like to help spark conversation, feel free to attend.  As for the "presentation", the topic is LINQ in the Real World where I'll be discussing how to leverage LINQ to solve every day programming problems with an overall goal of improving "flow" of the code that will also assist in the long term maintenance.  Hope to see you there!
    05-14-2009, 8:43 AM by CorySmith to AddressOf.com
  • Looking for suggestions...

    What would you like me to write about?  Send me a message via any of the contact information (look to the left; if reading this in a aggregator, visit the site ;-))

     Yeah, I know, I should have comments turned on; however, comment spammers are vicious and adding road blocks to comments just seems wrong.

    Anyway, if you have something you'd like me to talk about, shoot me a message and I'll take it under consideration.

    05-01-2009, 1:06 PM by CorySmith to AddressOf.com
  • INETA

    Oh yeah, by the way, I'm now an INETA speaker. ;-)

    What does this really mean?  Well, if you'd like to get me to come out to your user group, all you need to do is put in a request to www.INETA.org and they'll help with the travel/hotel expenses and even pay for the pizza!  So here's a chance that you and I can meet face to face, no matter where you live. :-D

    For the record, I'm not a "big shot" "important" "super smart" "graduated at the top of my class" kind of guy; I'm just a regular guy who likes computers and code (preference with VB).  So if you're looking for a "lecture", I'm not that guy.  If you're looking for someone to spark conversation; that might be me.

    Anyway, just wanted to share that there is an opportunity for you to "use and somewhat abuse" my willingness to visit and hang out with your user group; wherever that may be.  And, of course, give a HUGE thank you to the folks that operate www.INETA.org (and all of their sponsors).

    Feel free to contact me if you'd like to discuss this further.

    04-20-2009, 7:30 AM by CorySmith to AddressOf.com
  • Open Letter to the ClickOnce team.

    I really like using ClickOnce; however, there are a couple of annoyances that I'd wish would get resolved.

    1. Can we please get a "sync versions" checkbox somewhere?  Meaning, why do I have to change my version number in three different places?  I'm sure there are cases where this is desirable; however, I don't believe that it is the norm.  So here's my suggestion:  On the Assembly Information dialog, next to the Assembly version and File version entries add a "Automatically Syncronize with ClickOnce publish version" type checkbox.

    2. Can we please... pretty please... just get a checkbox that says "Always require latest version." in the Application Updates dialog?  I like having the "Specify a minimum required version for this application" ability; however, I would like to ALWAYS require this.  As it is now, I have to change the Publish Version, click on the Updates button and change the version there as well.

    I have other annoyances; however, I believe that the impact of getting them finished in time for VS2010 would be too much; so I'll leave it with these.  I don't think these would be major changes and wouldn't require a huge amount of testing to get implemented.

    Thanks for your consideration.

    Cory Smith

    04-17-2009, 6:23 AM by CorySmith to AddressOf.com
  • Microsoft MVP Summit 2009

    I decided that I would be adventurous this time around going to the summit.  This time around it's just me, my motorcycle, whatever technology I can carry and over 5000 miles of roadway.  I've never been on this long of a a trip and have never done this sort of trip without others (noone else I know, it seems, is insane enough to attempt this sort of trip in the time frame I'm attempting to do it). 

    In addition to going to the summit, I'm headed down to L.A. and Las Vegas to meet up with some martial arts friends for a bit of training...

    Everything is packed.  Getting ready to catch some sleep and getting up in the morning to get on the road at around 5am.  I'll be twittering, twitpic'ing and blogging when I can; so feel free to virtually follow along.

    To all of those going to the MVP Summit... look for me in the the Westin lobby every evening. ;-)

    02-25-2009, 12:18 PM by CorySmith to AddressOf.com
  • Expired ClickOnce Certificate

    January 7th, 2007 - Got bit by the expired temporary certificate issue when trying to deploy a ClickOnce application.  Never got a "real" certificate since it wasn't necessary for the needs of this particular application.  You can't just replace the certificate because that would require that every basically uninstall the old version and visit your deployment location to reinstall.  So the only solution at the moment was to change the date on your deployment computer and publish accordingly (it seems the expired certificate only relates to using it to deploy; not the actual installation).  After talking with several people at Microsoft, a "fix" was on the way in the form of the RenewCert.exe sample project.  This small console application can be run against and existing temporary certificate and extend the date of it by five years from the date that you run it.  Problem solved.

    January 6th, 2008 - Visual Studio 2008 was available and the project(s) that were built by someone else were being combined into a single executable.  Since this was the case and it was also a case of a new .NET Framework being used, requiring a new install wasn't an issue (even though the certificate in question was already taken care of).  I decided to go ahead and give this "issue" another chance since there was also a revamped ClickOnce with the new framework.

    January 6th, 2009 - @#%@#$$@#%%@ Same issue.  Oh well, time to find that RenewCert.exe and run it.  Doh... some Side-By-Side issue.  Had to rebuild the C++ console application to get it to work.  Renewed the certificate and now things are moving forward again.

    I'm sure there is some lesson to be learned here; however, the point was that I was able to get back on track.

    Now, apparently Microsoft has come to their senses with .NET 3.5 SP1 and modified the ClickOnce deployment to allow people to not have to sign their deployment manifests.  I just tested a project deployed with signing, then extended it using RenewCert.exe with .NET 3.5 SP1.  Works great.  Then I took the next step of unchecking the sign ClickOnce manifests to see if the project would still install without any issues (meaning not wanting to cause issues with end users) and other than the warning you get when deploying regarding that you are changing the certificate (not changing, removing... hmmmm), the upgrade worked without any issue.

    I also ran this using the .NET 3.5 as a prereq in the deployment; however, the test machine now had .NET 3.5 SP1 installed, so not sure if it was a valid test.

    Either way, having the option to not have to sign is a nice feature; especially if you are in an intranet environment.  However, I'm not sure that I want to open this completely up on a server that is out in the wild; though it's probably not a huge deal considering the many factors that could go into the deployment, target audience, server security, etc. involved.  Since I have a solution that can extend the certificate, I suppose I can ponder this on another day...

    For a slightly modified version of the Microsoft solution, go here. NOTE: I strongly recommend downloading and reviewing the source; build from that.  Don't trust exe's from an unknown source... not saying anything negative specifically about this source, just as a habit... don't do it.  If you know the person, then at least you know who you can track down accordingly.  Although I don't know him, I want to thank Cliff Stanford for providing this as a project solution.

    NOTE: This post is more for me as a reminder for when I use ClickOnce for the next project. If it gives you some food for thought, excellent!  ;-)

    UPDATE: Of course all this worked with a test project/deployment.  When I had to do this on a REAL project, things didn't go so smoothly.  Final result was to reverse everything I had done and set my date back to December 1, 2008 to get it to publish.  Still investigating what is going on here; one major difference is that I also have all of the related assemblies strongly signed.  I have no idea if that is an issue or not; however, the error I was getting was found on a couple of websites as something similar (but no mention of expired certificates) and, wouldn't you know, no one had replied with any sort of suggestions or possible solutions.  When I get a moment, I'll dig into this deeper and provide another update.

    UPDATE/SOLUTION: I had to get the original Microsoft solution working in VS2008 (the source shown on the site didn't want to compile in the latest version, was originally for VS2005).  I so love how C++ seems to CHANGE every single version and not work with prior versions.  I suppose if I was a C++ expert, this would be old hat; however, I only use it out when necessary so count me as a newb. ;-)  Anyway, once I got it to build (and this time I built it in RELEASE mode so that the .exe would work side-by-side in newer versions of .NET) it modified the certificate and everything worked smoothly after that.  If you need the updated source, let me know and I'll be glad to make it available.

    01-13-2009, 9:14 AM by CorySmith to AddressOf.com
  • Fort Worth .NET Users Group - January 20th

    If you're in the area, don't miss my presentation: What's New in .NET 3.5 Service Pack 1.

    Additionally, I've decided to extend Microsoft's extreme generosity by giving away a copy of MSDN Premium **WITH** Microsoft Visual Studio Team System 2008 Team Suite!!!!!!  Yes, you read that correctly!  It's the edition that lists for $10,939!!!!!!!

    I'm not giving away the actual packaged product, but what I'm giving away is a card that contains an activation number so you can activate your 1 year subscription.  All you have to do is show up, participate in the meeting... oh yeah, and you ***MUST*** RSVP, following the instructions on the Fort Worth .NET Users Group site!!!!

    Even if you don't win, it is my hope that your intention was to see my presentation. ;-)

    01-03-2009, 1:12 PM by CorySmith to AddressOf.com
  • Action Movie Night - January 17th

    It's time again for Action Movie Night!

    This is just a quick reminder regarding the Action Movie Night taking place Saturday evening, January 17th, 2009, starting at 6:00pm located at my house so space is limited to those that RSVP.  The movies being shown are:

     AND 

    This time around the theme is "The dark side of computer automation".

    In addition to the movies, I’ll also be firing up the grill for a grillin’ session (weather permitting).  This will start around 4:30pm and everyone is invited to bring their own slab of meat and try their hand.  (BGYO - Bring and Grill Your Own)  Some side dishes will be prepared to go along with your charred masterpieces.

    Feel free to bring your significant other, just keep in mind that if you do, I would hope that they are there to enjoy the movies first and foremost and won't be offended (at least not outspoken wise ;-) ).  It is still an 18 or older gathering though.

    For future AMN's, please send me a comment regarding what movies you'd like to see in the future...  Remember, doesn't have to be newly released moves... just movies that fit the "Action" category.

    If you'd like to attend, please let me know (via comment to the left, email, Facebook, Twitter DM, Live Messenger or, if you have my number, give me a call) and I'll get you further details.

    Oh yeah, I almost forgot... we'll be viewing these on my new Pioneer 60" Plasma!

    01-03-2009, 12:57 PM by CorySmith to AddressOf.com
  • Linq - Episode 1

    Linq is very, very, very cool.  I can easily envision looking three years from now and wonder "how did we write software without Linq?".  Several recent language editions have helped to reduce code needed and thus made my development life easier.  However, I have to say that Linq is something that seems to hit a home run in several distinct areas to improve my development life.  Over the next few posts, I'm going to outline a few "real world" examples that I've been using.  Understand, I'm still learning Linq... and even without knowing all of the ins and outs, it is extremely helpful in everyday coding.

    Finding, filtering, connecting data is much more "natural" using Linq.  No more using a For loop to find a piece of information.  How many times have you written the following code:

    Dim exists As Boolean
    For Each item As SomeClass In items
      If item.SomeValue = targetItemValue Then
        exists = true
        Exit For
      End If
    Next

    All of this just to find out if we have a value that matches.  Now compare that with the following:

    Dim exists = (From item In items _
                       Where item.SomeValue = targetItemValue _
                       Select item).Count > 0

    Sure, it's less "code"; however, the real point here is that once you have a basic understanding (and I do mean basic) of Linq, the above code is much more concise and very quickly expresses the overall intent.  I firmly believe that coming back after a year and seeing the above two versions of code, the Linq one will be much more easily to grok and maintain.

    Unfortunately there is a downside to Linq.  Linq doesn't seem to play nice with Edit & Continue; so if you have issues with your Linq statement(s), you won't be able to change them while debugging.  This is extremely unfortunate as I see it will hinder some of the adoption rate for integrating Linq into existing projects.  However, under real world scenarios, I've been able to, using Linq (even without E&C) to restructure complicated code, make it much more understandable, improve on the overall logic because it's more understandable and create (hopefully) much more robust code in the long run.  The lack of E&C is a let down, but overall I think the down side is acceptable given what is gained.

    See you in the next installment.

    06-02-2008, 1:55 PM by CorySmith to AddressOf.com
    Filed under: , ,
  • MVP Summit 2008 - Day 1

    Although the MVP Summit doesn't actually begin until Monday morning, a lot of activities are scheduled by those in the community just prior to the Summit. 

    For the last four years, Rod Paddock (Editor-in-Chief for Code magazine) has hosted a BBQ gathering at his house.  This event has not failed to impress and the opportunity to visit with those whom I've been fortunate enough to gain as friends over the past few years over some grilled food is great!  Thanks Rod for making this opportunity available.

    Then it was over to the vbCity.com crowd to hang out with (mostly) Visual Basic related enthusiasts.  This was my first year to participate in this dinner gathering and it was excellent!  Conversation and food were excellent.  This event was also a great opportunity to interact with several people from outside of the USA.  And it is always a pleasure to hang out with a large group individuals who are passionate about Visual Basic.

    Party with Palermo - MVP Summit Edition 2008 was great, yet again!  Thanks to Jeffrey Palermo for continuing to put this together.  It's amazing how well this thing comes together year after year.  This is probably the number one opportunity for *ALL* MVPs to network and have some fun just prior to the Summit as it is open to MVPs of all categories.

    As for this morning, I'm getting a bit of work done before the lunch at the convention center.

    04-14-2008, 8:25 AM by CorySmith to AddressOf.com
  • Busy, busy, busy...

    Sorry for the lack updates; it definitely hasn't been due to a lack of ideas. ;-)  So here's a quick update before I have to get back to it.

    Right now I'm preparing to head to Redmond for a week of interaction with the various Microsoft product teams and fellow MVPs from around the world.  Hopefully the agent I just spoke to on the phone regarding flight status is accurate and my flight will have no issues (it's an MD80, the ones that are having the inspection issues).  When I purchased the ticket back in February, the flight was for 7:40am... now it's for 6:45am... ouch... man that's early.  Not looking forward to a 4am wakeup call.

    This morning I did another Windows Vista for Developers presentation at the NTPCUG - VB group.  It's interesting to hear the questions, concerns and comments regarding the state of Vista.  Once I share some of the information, I think some people are left wondering why there is so much resistance in moving to Vista.  Ultimately I think that Vista is the first consumer OS released by Microsoft in an age of laptops and manufacturers are being substandard in supporting products that they've already sold; not that it's entirely their fault... they are busy working on new products and laptops are definitely a product that requires a balance between the hardware, drivers and other software.  Just throwing a new OS at it isn't necessarily a good idea.  There are other issues and I can't answer to as why so many people seem to be anti-Vista; all I can say is I've been running it since release on all machines I use.  I'm happy.  The first crash I encountered was this week when a Raptor 150 drive decided to puke its guts out... my first OS re-install in over a year and a half.  Something I can't say when I was running anything prior.

    The recent Visual Studio 2008, SQL Server 2008 and Windows Server 2008 launch event was fun as usual; however, I was a little disappointed in the lack of "tough" questions.  Of the questions received, they ranged from Linq, SQL Server 2008, BizTalk, IIS and Vista (of which I deferred to the "booth" next to us manned by people from the Vista product team).  There were also some questions regarding moving to Visual Studio 2008 from prior versions.  So the only real developer questions were surrounding Linq.  Which brings me to my next subject...

    Linq is freakin' AWESOME!  Expect to see a lot more from me in the near future regarding Linq in the real world.  I'm still getting my head around all the finer details... and so far I'm very impressed in the breadth (or would that be depth) that Linq offers.

    Still working on growing the two DNUX groups in the area and have my first "it's not me presenting" speaker coming to the Dallas DNUX this month.  David O'Hara will be presenting; which will allow me to focus a bit more on the Fort Worth .NET Users Group local VS'08, SQL'08, Server'08 launch event taking place later this month.  I'll also have to put together another topic for the Fort Worth DNUX, so if you have any suggestions, fire them my way.

    I'm going to have a new batch of samples coming soon; in addition, I plan on migrating all existing samples to 2008 as well.  One particular one I'm working on that will also have a related article is using Vista Aero ("Glass").  Yes, some others have shown how to do this, but I think you'll be interested in my particular angle on it. ;-)

    I still have a write up planned that will discuss my working on a daily bases in three different development languages; this will include the positives and negatives encountered... but will not be a versus article.  The three languages are Visual Basic, C# and T-SQL.

    In early May, I'll be the official Prize-man for the Dallas Tech-Fest, so be sure to come by and say hello.  Early June is Tech-Ed 2008 (Developers)... I'll be there as well hanging out in the product group areas answering (and asking) questions.

    04-12-2008, 3:26 PM by CorySmith to AddressOf.com
  • Fort Worth DNUX - 2/27/2008 @ 6:30pm

    If you are in Fort Worth and interested in getting up to speed on WPF/Silverlight... XAML is one of the key components of doing so.  Tonight's presentation is XAML 101 being presented by yours truly...

    Hope to see ya there.

    http://dnux.org for more information.

    02-27-2008, 9:42 AM by CorySmith to AddressOf.com


AddressOf.com
About AddressOf.com
AddressOf.com is the place for the Visual Basic developer. All topics at all levels are touched upon here. One of the main goals of AddressOf.com and its members is to promote Visual Basic as the tool for choice for all developers; yet understands that sometimes other tools better suited to specific tasks and, as such, have an open acceptance to all products that allow us, the developer, to get the job done in a timely and efficient manner.

Who is Online

There are 30 guest(s) online. Currently there are no online users.

My Xbox Friends