Wednesday, January 23, 2008

Shiny new thing to eat up bandwidth!

I'm a solo developer in a corporate environment, so I'm really on my own to learn new things.  As good as blogs and books are, there's sometimes no substitute for being shown how.  That's why Microsoft highlights so many videos on its asp.net site.  ASP Alliance also has a growing library of videos.

Enter onto this list one more site--DotNetVideos.net.  Right now there are around 100 videos on a great number of topics.  Apparently there are a couple hundred more in the pipeline.  And, if you sign up now, you get 6 months of ASP.NET Pro magazine for free.  That alone is worth the sign-up.  ASP.NET Pro is one of my favorite trade mags (I have an online subscription, and have for several years).

When you're Googling for info on whatever you're working on, don't forget to check out this site, too, and see if someone is showing you how it's done.

Full disclosure: I was asked to say something about the new site, and I usually ignore such requests.  But after checking it it, it's one I'll be spending some time on, and recommending to others.

(edit - fixed links)

Wednesday, January 23, 2008 11:03:13 AM (Eastern Standard Time, UTC-05:00)
 Tuesday, January 22, 2008

Assuming you don't actually have both a DataSource and DataSourceId defined on the same control, this may actually be a bug.  My situation is Visual Studio 2008, compiling an application for .NET 2.0.  I tested this with both Enterprise Library 2.0 and Enterprise Library 3.1.  For me, I'm trying to hydrate a RadioButtonList from a dataset, which is created from a stored procedure call with a parameter passed.  If I hardcode some values in the sproc and don't pass the parameter, it all works fine.  But, if I pass the parameter, I get the error.  I have a workaround in mind, and I'll post it whenI get it done.

I reported this at http://connect.microsoft.com/, with an issue ID = 323454; the title is "Both DataSource and DataSourceID are defined...".  If you're having the same problem, log in and vote for this issue--more votes = higher priority.  The text of my report is below:

I'm using VS 2008 (9.0.21022.8 RTM), compiling for the .NET 2.0 framework.

On a web form, I've added a RadioButtonList, as below:

<asp:RadioButtonList ID="rblShippingPlatform" runat="server" CssClass="FormFieldsAjax" />

In code behind, I call a function in a CBO in the same project to hydrate the values:

cPub.fillShippingPlatforms(rblShippingPlatform, cPublic.Segment.Lane)

The function in the CBO makes a call to the DAL, which is a shared library added as a project reference:

    Public Sub fillShippingPlatforms(ByVal rblPlatforms As RadioButtonList, ByVal sSegment As String)
        With rblPlatforms
            .DataSource = cDb.GetShippingPlatforms(sSegment)
            .DataValueField = "ShippingPlatformID"
            .DataTextField = "ShippingPlatform"
            .DataBind()
        End With
    End Sub

The DAL simply executes a stored procedure and returns a dataset:

    Public Function GetShippingPlatforms(ByVal sSegment As String) As DataSet
        dB = DatabaseFactory.CreateDatabase
        cmd = dB.GetStoredProcCommand("lpGetShippingPlatforms")

        With dB
            .AddInParameter(cmd, "@Segment", DbType.String, sSegment)
            Return .ExecuteDataSet(cmd)
        End With

    End Function

There's nothing fancy here, but when I load the web form, I receive an error stating "Both DataSource and DataSourceID are defined on 'rblShippingPlatform'. Remove one definition. ".

I can hydrate the RadioButtonList if I adjust the stored procedure and remove the parameter handling.

    Public Function GetShippingPlatforms(ByVal sSegment As String) As DataSet
        dB = DatabaseFactory.CreateDatabase
        Return dB.ExecuteDataSet(CommandType.StoredProcedure, "lpGetShippingPlatforms")
    End Function

This issue occurs with both the Jan 2006 and May 2007 versions of the Enterprise Library.

Tuesday, January 22, 2008 11:22:04 AM (Eastern Standard Time, UTC-05:00)
 Saturday, January 19, 2008

Maybe winter isn't the best time to be ordering from Proflowers.  In this video (http://www.youtube.com/watch?v=FNYGZHPKQgs), a box is left at the front door on a 7 degree day, and are frozen solid.  Yikes!

Proflowers' advertising is not exactly honest--their claim of "fresh from the fields" is untrue, they've been sued for saying that, and they're supposed to cease and desist.  Sleazy.

Looks like FTD.COM is also getting some unflattering coverage (see video at (http://www.youtube.com/watch?v=brzya0F3sVw).

More info on Proflowers at http://www.floristdetective.com/wst_page15.aspx.

Saturday, January 19, 2008 9:47:30 PM (Eastern Standard Time, UTC-05:00)
 Monday, January 14, 2008

Registration is now open for the Pittsburgh launch of Visual Studio 2008, SQL Server 2008 and Windows Server 2008.  The launch is April 14 at the Westin Convention Center--additional details as they become available.

The date seems to have changed--I recall is being April 4 last week, so make sure you schedule the right day to be out of the office.

Register at http://www.heroshappenhere.com/.

Monday, January 14, 2008 11:18:34 AM (Eastern Standard Time, UTC-05:00)
 Monday, January 07, 2008

One of Dell's selling points for its new Vostro line is a lack of trial-ware.  In fact, Dell's website makes the following claim on the Vostro homepage:

No trialware.
Customers said they hated trialware, so we took it away. Vostro systems come without annoying trialware pre-installed. You only get the software you want.

If only it were true that you only got the software you want.  Remember these machines are designed and priced for small offices, 1-25 employees.  You know the kinds of offices these are--they're the ones without IT, and are subject to the whims of their vendors.  We recently purchased three Vostros (two Vostro 200 slim towers to expand the POS in my wife's flower shop, and one Vostro 1500 laptop for myself), and I was dismayed to find software I didn't really want on all three:

1) Google Toolbar is preinstalled with IE.  Google recently seems to have changed its motto from "don't be evil" to "total world domination", and I understand they pay a bounty to Dell for preinstallation of their toolbar.  In case you've missed out, Google's been involved in a couple of privacy flaps lately.  The toolbar remembers where you go and what you do, which has probably been a reason for some of these unsecured data exposures on the Internet--the file location was sent to Google after being accessed by an unsuspecting user, and Google indexed it.  Yes, the business was stupid to not secure the data, but Google is the one who indexed the data and made it public, so I hold both complicit.

2) Google Desktop.  This one is worse than the toolbar, IMHO.  Again, it's my understanding a bounty is paid for each installation.  And again, there are privacy issues, especially since it opens (automatically, BTW) with default settings.  If the user doesn't know the software is installed and is indexing their documents, they might be surprised to see them show up in their searches.  While usually pretty secure, Google's various properties have been subject to exploits recently, and there is the chance sensitive data can be compromised because of the Google desktop.  Additionally, Google Desktop introduces unexpected keyboard behaviors (e.g., double control brings up a search box), and for unknowledgeable users, this software makes their computer a thing of surprise.

3) The Dell Search Redirector.  Oh how this one works my main nerve!  If you goof a website's address in IE, you're transported to a Dell/Google cobranded page of "suggested results" and (drum roll please) AdWords ads.  The standard "Internet Explorer couldn't find the website you're looking for" page has been totally replaced.

4) Dell Network Assistant.  Yet another replacement for Window's built in network connection utilities.  Granted, the user-friendliness of Windows XP's network management is really low, but the Dell NA takes forever to find the preferred network and connect.  How slow is it?  I can boot, open Thunderbird and have it searching for my e-mail servers, and it's still another minute or so before DNA connects.

5) Dell Support Assistant.  I feel bad for people who agree to use this one.  You get the annoying toasts saying there's some update for your PC somewhere, but the UI is confusing and uninformative.  If there's an alert, I should be taken right to it when I open the tool.  Plus, we don't need the staff freaking out that something is wrong with the new PCs just because an unexpected notice pops up.  That's disruptive to the day's work, and takes them out of their flow if they're taking an order and one of these messages appears.

Now, you can turn off and uninstall all of these options, but that's not very friendly.  It should be that I can turn on anything I want, not have to turn off what I don't.  Except for the Dell Network Assistant, all of the others have been removed from our PCs.

kick it on DotNetKicks.com

Monday, January 07, 2008 10:19:56 AM (Eastern Standard Time, UTC-05:00)
 Thursday, January 03, 2008

A little birdie just told me Pittsburgh Code Camp 2008 is confirmed for April 12 at Pitt's Sennott Square (Department of Computer Science).  Watch the Pgh .NET website for more information.

Thursday, January 03, 2008 4:28:07 PM (Eastern Standard Time, UTC-05:00)
 Wednesday, December 26, 2007

My latest ASP Alliance article has been published:

Easy SQL to XML with LINQ and Visual Basic 2008

In this article, I demonstrate how to create an XML file from a SQL Server 2005 database using LINQ. He provides a detailed explanation of the relevant steps with the help of source code and screenshots captured from Visual Basic 2008 Express Edition. At the end of the article, he also gives a few references where you can learn more regarding the techniques involved with LINQ.

If you're looking for a super quick intro to using Linq to SQL and Linq to XML using Visual Basic, this might be what you're looking for.  I've added links to a couple other useful references, too.

Wednesday, December 26, 2007 2:19:40 PM (Eastern Standard Time, UTC-05:00)
 Tuesday, December 18, 2007

If you've ever listened to Hanselminutes, you've no doubt heard Scott mention "code smell" or "pretty code".  The new language features in VB9, including LINQ and XML being a native type, make XML generation not only easy, but beautiful.  Aside from the color scheme, look at how smooth this code snippet is.

Dim _order As New XElement(<Order>
    <ShipperRef><%= h.UniqueRef %></ShipperRef>
    <UniqueRef><%= IIf(h.CustomerPo <> "", h.CustomerPo, h.JdeNumber) %></UniqueRef>
    <Comments><%= _orderComments %></Comments>
    <OrderType><%= h.OrderType %></OrderType>
    <Workflow><%= h.Workflow %></Workflow>
    <RORRelationship><%= h.RORRelationship %></RORRelationship>
    <Supplier><%= h.SupplierNumber.ToString %></Supplier>
    <Customer><%= h.Customer.ToString %></Customer>
    <FreightBillableParty><%= h.FreightBillableParty %></FreightBillableParty>
    <MethodOfPayment>Prepay</MethodOfPayment>
    <HAZMAT><%= h.Hazmat %></HAZMAT>
    <GroupAssignment><%= SetGroupAssignment(h.GroupAssignment) %></GroupAssignment>
    <Weight><%= _orderWeight.ToString %></Weight>
    <Volume><%= _orderCube.ToString %></Volume>
    <OrderContact><%= h.PrimaryContactAssignment %></OrderContact>
    <ShipmentContact><%= h.PrimaryContactAssignment %></ShipmentContact>
    </Order>)

My VS 2008 theme is DesertNights, and the code was copied with CopySourceAsHtml.

 |  |  | 
Tuesday, December 18, 2007 12:41:21 PM (Eastern Standard Time, UTC-05:00)