Category Archives: dotNET

more on VS.NET 2005 Tech Preview Installation

Well, I finally decided to just trash my current Whidbey PDC bits and install the Tech Preview right on my laptop. No VPC  – just let this be the box for it. Having made that decision, I went to MSDN and saw that the download is 4GB. I do have DSL but still that will be more time than I feel like dealing with. Maybe I can just grab a dvd when I go to Redmond in a few days. I think I’ll just wait a little longer…

“exec sp_executesql” = NOT a Stored Procedure

This has bitten me in the rear twice in the last few days while working on some webmethods. I was erroring out on a sql ExecuteNonQuery with the only message being that there was an error on line 1 of my command. Looking in my SQLProfiler I see my query as

exec sp_executesql N’MySprocName’, N’@myparam char(20)’, @myparam = ‘3/30/2004 1:48:22 PM’

“exec sp_executesql” is used for commands that are text, NOT stored procedures. The problem here is that I forgot to set my sqlcommand type to StoredProcedure and it was being sent to SQL Server as a query string and therefore failing.

This is a good indicator of the problem so that you don’t have to go around and around trying to figure out what is wrong with your stored procedure (as I did – once but not twice!)

Using multiple dataviews of one datatable

I banged my head over a problem for a while a few months ago. I was using a lookup datatable for a dropdown and also trying to use it for a search (to get some more key info when the user selected an item for the drop down). But this was screwing up the display in the dropdown.

The problem makes so much sense. Even though I was using two separate dataviews from the datatable, changing the pointer (record position) in the dataview really changes the position in the datatable, thereby affecting any dataviews based on the table.

Since the table is only a lookup table, I was able to solve the problem by creating a dataview based on a copy – datatable.copy.dataview, and using THAT dataview for the 2nd function where I was doing the search.

I had the gratification of having two people who had also been struggling with this same problem ask me for help. One was using two separate views of a lookup table for two dropdownlists, the other was using two separate views of a lookup table for two datagrids.

I supposed if you need to edit, then you have deal with that copy, since it is not going to be updated automatically.

time for transactions

Transaction processing for databases is one of those things I have always been ashamed that I never used  – though in most of my small applications, I only do one insert/update at a time. Now with .NET they are really easy to implement so no more excuses. I’m busy right now sticking them in my webservice back end that has a variety of methods that do different multiple updates and inserts – so I really do need to have transactions. If I have to do 5 inserts and one of them craps out, I am going to be WAY better off in my client application if I can rollback the whole gaggle of records.

VB Team coming to Boston.NET User Group April 14th

Well, I did explictly choose to live far from a major metropolitan area, so I can’t whine that I will probably be missing this:

http://radio.weblogs.com/0131777/2004/03/24.html#a97

Actually, the VB Team is going to visit a bunch of user groups around the country. I don’t have a list, but keep an eye on your user group web page! Robert Green says that there will be a VB Events list on the msdn.microsoft.com/vbasic dev center.

April at Vermont.NET USer Group – XML Night

Our next user group meeting for Vermont .NET is “XML Night”. We have Joe Stagner, a Microsoft Developer Community Champion who is located in the Northeast (and has been a big help to our user group along with our D.E. Thom Robbins) coming to talk about Secure XML and also Altova‘s Trace Galloway is going to give us a whirl around XMLSpy. It is easy to get these guys to come here. The New England Microsoft folks LOVE Burlington and Trace went to college here. Old home night! April 12th. more info…

Where to find DevDays demos

I had an email from a Boston attendee who was trying to figure out where the demos could be found on the dvd. I looked myself and realized that although the OpenHack and IssueVision source code were on the cd, the actual little demos during the earlier sessions were not. I told him I would keep looking and pointed him in the meantime to DevDaysBloggers.com. Then he discovered through those blogs that the demos were available on the MyDevDays website.

Remember that ALL of the good practices code is wrapped into the applications. The demos can let you compare good/bad, before/after. I think that this is sometimes a useful way to really understand how things work and why you want to do things in a certain way.

If you were an attendee, you can log into the www.MyDevDays2004.com website. I had to dig around a little bit but here is where you can find the demos: