Category Archives: dotNET

ListControl: “could not bind to the new display member”

This error message was thrown when trying to set ListControl.ValueMember=“mydatafield“

I know I had this problem once before and wasted a lot of time trying to solve it.

I found nothing helpful via google (though a hint about Oracle that referred to case sensitivity which I stupidly ignored since it was Oracle).

Finally it occured to me (as it has in the past) that the damned thing is case sensitive.

Just check what the datatable has as the column name and follow the casing exactly.

I thought I’d stick this here for the next poor sucker searching in Google for this problem.

A better way to store user preferences in .NET apps?

It is definitely a conundrum. Do you use the registry? (easy as pie to code to, with lots of potential security and other issues) Do you leverage Isolated Storage? (a very secure way to write and read local files in managed code, but designed for files – which means a lot of coding to get info in and out.)

I started out with the easy way I was already familiar with – the registry. Then when I got bit with my first registry permission problem, I learned how to use Isolated Storage and had to code up all of the file stream, read line, write line business which is a PIA (though I suppose I could create an xml file, store it in isolated storage, open it up in a datarow and grab what I need). So I was happy to see what looks like an awesome article in this month’s MSDN Mag (as of this writing  – most of the articles are not online yet) called User Preferences: Manage User Settings in Your .NET App with a Custom Preferences API by Ray Djajadinata. I have read enough of the article so far to recognize all of the same walls I have encountered with this, so I look forward to digging further in to read about how Ray has solved this problem.

Tablet PC Developer Tour to arrive in Boston on Wednesday

This is a half day free seminar from the Microsoft Tablet Team and the Leszynski Group that is targetted to developers. It hits Boston this Wednesday, June 9th.

The sessions focus on core features of the Tablet SDK and will be code and API intensive. 

Date: Wednesday, June 9 2004, Start Time: 1:45 PM, End Time: 5:00 PM

Tremont Hotel   275 Tremont Street, Boston, Massachusetts 02116, Room: Empire Room

Here is the description of the event

The Microsoft Tablet PC Developer Tour
The Tablet PC is a next-generation PC—the evolution of the notebook PC. Tablet PCs run the Microsoft® Windows® XP Tablet PC Edition operating system, which incorporates the convenient and intuitive aspects of pen and paper into the PC experience. The Tablet PC provides all the performance and features of today’s notebook PCs in an ultra-light form factor, and has the ability to run full versions of standard Windows applications. Providing advanced handwriting recognition and a natural interface for entering data using a digital pen in addition to your keyboard, the Tablet PC opens exciting new opportunities for mobile computing.

This free course provides an overview of Windows XP Tablet PC Edition features for developers, architects, systems integrators, and solution providers. Plan to spend a few hours with us and we’ll teach you what you need to know to get started. The sessions will cover:

  • Tablet PC Platform Overview
  • The Tablet APIs, Object Model, and available components and controls
  • Complete coverage of the new features available with Windows XP Tablet PC 2004 Edition
  • Code samples and demonstrations across all the main features
  • Discussions around designing and deploying Tablet PC Applications
  • Q & A time for more in-depth questions
  • Each session will be delivered by Microsoft Tablet Employees or a Recognized Tablet PC Expert from the Leszynski Group. This is an opportunity you don’t want to miss. Register soon, as space is limited.

Who Should Attend?   
   All developers interested in a detailed overview of the Tablet PC Platform should plan on attending. These sessions focus on core features of the Tablet SDK and will be code and API intensive. 
 
You can still register for this event from the www.tabletpctraining.com/microsoft site.

I had planned to go but since it is a 4 hour drive each way, and I just attended similar sessions at TechEd, I think I am going to skip it and work on my demos for my own tablet PC SDK talk at DevTeach in a few weeks.

Nullable Types in VB and C#

I read with great interest Paul Vick’s post on “The truth about Nullable types in VB“ vs. C# as I am talking about nullable types in my revised Whidbey BCL talk that I am doing at VTdotNET in a week and then at DevTeach in a few weeks.

I have played with nullable in the March preview bits, but not yet in the May and disappointed with the current (but slated for serious improvement by the bcl team!!!) performance when I compared the using nullable<t> over current options. So for example with value types: 

 – comparing myNullableInt.HasValue to (in VB) is myInt < 0

or with reference types

 – comparing myNullableThing.HasValue to “if not myThing=null”

the nullable type is currently much much slower. I have been promised by a few on the BCL team that the plan is to make the nullable MUCH more performant as it is their “best practices” suggestion (see Krzysztof’s Generics guidelines) to use nullable types.

I have also been given the hint that in the future, the following will be possible:

Nullable<T> Parse(string value);
Nullable<Int32> i = Int32.Parse( some String );

And will be more performant than TryParse. So that, too will be interesting.

It’s interesting to see all the groovy little shortcuts that C# is getting now and VB will be getting someday hopefully, though for now, all we really get of value (please correct me if there is more…) is the “hasvalue“ property which benefits us mostly for the value types coming back from databases.

VTSQL SIG Upcoming meetings on SQL Reporting Services and dates changed

Roman Rehak will be presenting at the next two Vermont SQL SIG meetings.

Note that the dates have changed from Monday to Tuesday

When: 6-8pm, Tuesday, May 18th. Where: Vermont Department of Health in Burlington.
SQL Server 2000 Reporting Services – An in-depth study Speaker: Roman Rehak Senior Developer at C2 Roman has implemented a real world Reporting Services application and will be sharing his newfound knowledge with us!

When: Tuesday, June 29th
Topic: SQL Server 2000 Reporting Services Programming SQL Server 2000 Reporting Services provide rich and powerful programming framework. This presentation will give you an overview of many available options for programming Reporting Services. We will cover the Reporting Services Web Service, URL Access, custom assemblies and custom extensions. We will also talk about integrating reports into both Windows and Web applications.

More on the “why so much whidbey and longhorn focus” discussion

Sean Campbell from 3Leaf, who with his partner Scott Swigart are known as “Early & Adopter” explains why paying attention to Whidbey today is a good strategy. This does not necessarily mean ALL of your attention, but it is one of the reason that I keep telling my user group members to at least take some notice of what’s coming up.

Simon Stewart had an interesting comment in my last post on this that it looks to him as though on the conference front, Microsoft is focused on bringing on board those who have not yet jumped to .NET and then the future products, but not as much on advancing the skills of people who are already pretty deep into .NET. (I hope this is a fair summary of the comment ….but best to read it yourself…)

Kathleen Dollard on dotNET Rocks this Thursday night!

New to blogging, but well-versed in programming!! Kathleen is a true VB and Code Generation expert, an MVP and you have likely seen her many many articles in Visual Studio Magazine.

She’s on dotNetRocks this Thursday night 10-12pm EST.

from Carl’s blog:

Rory and I will be talking with Kathleen Dollard about code generation, reflection, and other topics this Thursday night on .NET Rocks! Live at 10PM EST It is rumored that Don Kiely will stop by as well!  We’ll be giving away a copy of Microsoft Office Professional 2003 to a lucky listener, so come and hang out! Don’t forget to send us your Dumb Emails!

Keith Brown’s on line .NET Security book is even entertaining

Security guru Keith Brown’s A .NET Developer’s Guide to Windows Security  is on line and I’m reading parts of it in my last minute cramming for the 70-330 beta exam. Ach – I have to leave in 1 1/2 hours!

Anyway, I love stuff like this:

From the chapter on Configuring Security for a COM(+) Client (item 53):

It’s a pity that I even have to write this piece, or that it needs to be as complicated as this, but the COM Interop team, while they are content to automate the call to CoInitializeEx for you, apparently don’t feel the same about helping you with security. In fact, in a simple console or Windows Forms application, for example, nobody in the framework bothers to call CoInitializeSecurity. Didn’t anyone on these teams read [PWS]? Arrrgh!

and further on

Here’s the fun part. The normal place where you should call CoInitializeSecurity is when your program first starts up, right after your main thread calls CoInitializeEx. But the .NET Framework takes care of calling CoInitializeEx for you. It does it lazily the first time you make a COM interop call. But by the time you’ve made a COM interop call, it’s already to late to call CoInitializeSecurity! Bah!