Thursday, December 16, 2004

(aha! just getting a new name: CreateDataReader. Thanks for the info Jackie and Kawarjit (from the AD0.Net team!)

whoa. I just noticed this in the online docs that come up through the msdn library with vs2005 (which points to this link)

The same holds true (as per the above set of docs) for DataTable.GetDataReader.

However, if you browse to a separate source of docs at http://msdn2.microsoft.com/library/0xbt1065.aspx there is no indication of it being obsolete.

It works just fine in the October CTP bits I am using. I'm confused.



Posted from BLInk!
Thursday, December 16, 2004 6:22:30 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Brad Wilson pointed to a new article on www.DotNetDevs.com, which prompted me to go over to the site and see what else is there. What I saw thrilled me. A host of articles that are aimed at removing the bridge of fear that many people have of particular topics. "Reflection Demystified", "Understanding Isolated Storage", "Using Encryption in .NET" and more. The authors of these articles understand that "you can't know everything" and just because you don't understand a particular topic or concept, does not mean you need to be addressed as though you don't even know how to turn on a computer. Nor do they speak in tongues, taking a topic so deeply that there is no place for you to hook in so you can understand what the heck they are talking about. This site is looking like the chapters of the fantasy book I was dreaming of writing (but probably won't ever really write). Kudos to Brad Wilson and the other authors on the .NET Developers site.

Posted from BLInk!
Thursday, December 16, 2004 5:14:03 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Sorry - I had to beat Mary Jo to the pun, err punch. :-)

http://www.microsoft.com/presspass/press/2004/dec04/12-16GIANTPR.asp



Posted from BLInk!
Thursday, December 16, 2004 3:50:18 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
My INETA Winter Warmup arrived today. Dave Totzke did some hell of a job getting vendors to contribute. Here is a list of all of the vendors who contributed stuff. But I wanted to say an extra thanks to Programmer's Paradise. They also made an incredible donation. They packaged and shipped the mailing. Not only was it packed like a pro, but think about the fact that this went to all of the user groups in North America. That's about 250 groups. That's 250 boxes to pack and 250 * ?? for shipping each box. At least $5/box right? This is a huge contribution. So thank you SO VERY MUCH to everyone at Programmer's Paradise!

Posted from BLInk!
Thursday, December 16, 2004 3:09:41 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I got a monthly beer delivery for for Rich from www.hogshead.com a bunch of years ago and it is really awesome.

Groovy little micro breweries from around the country that you might never know of unless you travelled to where those beers are made. I'm getting this for a really fantastic client this year.



Posted from BLInk!
Thursday, December 16, 2004 1:44:01 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Larry O'Brien points out that Office has been updated with improved ink recognition. I haven't played with it yet - I still don't use my tablet for this type of stuff. (she said, sitting in front of her big desktop, 19" monitor and typing away at the keyboard - but still using BLInk! to write the post...)

Posted from BLInk!
Thursday, December 16, 2004 1:00:35 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Very cool!!! Short films do not have many venues outside of film festivals in the u.s. Amazon Theater is actually showing some right on their website! Granted there is some serious product placement going on. I don't know if the films are created with the goal of featuring items you can buy on Amazon, or if Amazon scours the films to find items that they sell. But there is a page that says “see something you liked in the movie? Buy it here“ Sheesh - but still....



Posted from BLInk!
Thursday, December 16, 2004 12:11:03 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Why wait when Beth Massi has created a tool to do it now?? In fact, she did this in February!



Posted from BLInk!
Thursday, December 16, 2004 12:07:09 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Wednesday, December 15, 2004
I wonder if this is what Jason's newscasts look like! :-)

Posted from BLInk!
Wednesday, December 15, 2004 4:36:02 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

INETA has added 8 new speakers to the North American Speaker Bureau!!

They are:

:-).

If you want to be considered for the INETA Speaker Bureau please refer to this blog post by Committee Chair, Scott Bellware.

Posted from BLInk!

Wednesday, December 15, 2004 3:51:47 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Just a reminder!!

www.vtsda.org



Posted from BLInk!
Wednesday, December 15, 2004 10:23:06 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Code Camp III is looking for speakers for the Mar 12/13th event in Waltham MA. Code Camp II had 62 speakers. Out of all of them, there was one chick and she was a 'Softie. Surely there are some women developers in the Boston area who have something cool and .NET-ty or related to talk about?? This is not an event where the coordinators invite speakers. Anyone can submit sessions. You don't have to be an experienced speaker even. There are not only session rooms, but chalk talks, which are small and you would lead a discussion but not necessarily stand in front of a crowd doing powerpoints and demos. Here is a document that you can use to submit ideas for talks. Here is where you can see what the schedule looked like for Code Camp II.

Posted from BLInk!
Wednesday, December 15, 2004 9:44:32 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Tuesday, December 14, 2004

Over the last few days it has been snowing lightly but constnalty. Now there is a beautiful blanket of fluffy white snow about 6" deep. It would have been a perfect day to play hookey and go ski out in the fields. Lucky for everyone who's waiting for stuff from me that I'm stuck at home in front of my computer with a broken foot! :'(



Posted from BLInk!
Tuesday, December 14, 2004 3:28:22 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I have to look further into this but look at the pattern of where DataTips are available (green) and where they are not (red)

If you haven't seen DataTips yet, it's like an inline quick watch window during debug



Posted from BLInk!
Tuesday, December 14, 2004 9:45:31 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, December 13, 2004

John Robbins is speaking tomorrow night in Montreal at GUVSM . He and his wife, Pam, decided to take advantage of being in that fantastic city and went up a little early, passing through Burlington. So we met up yesterday for lunch at the Burlington Pub and Brewery and then wandered around Church St for a while, visiting some of my favorite places I like to show off to out of towners: Frog Hollow State Craft Center and incredible shop featuring some of the finest crafts people (and even companies like Simon Pearce) in Vermont, Lake Champlain Chocolates (mmmmmmm...) and some others. I couldn't lure them into Kiss The Cook, but Rich and I got to go afterwards.

It is really fun to hang out with fellow geeks and NOT talk shop! It's kind of rude to geek out when 1/2 of the group (i.e. Pam and Rich) are not geeks. So we got to just have a normal time talking about normal things - food, travel, food, travel and beer, too. (just kidding).



Posted from BLInk!
Monday, December 13, 2004 11:23:48 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

read this and then this post to understand the problem.

Well ... I started out trying this against pubs and it didn't work and then I tried it with AdventureWOrks and it didn't work. I focused on pubs and made a lot of changes without it working. Then I finally went back to AdventureWorks and it did work!! So I'm not sure exactly which thing I changed previously, but the to get pubs to work with query notification was in the DataBase, I needed to set the Database Properties/Options/Miscellaneous: "Database Compatibility Level" to Version90. It had been at Version80.

Note that all of the other Miscellaneous options for pubs were set to false and I did not have to change them for it to work.

Wally McClure and I talked about some of the issues about when to make particular calls. I found that the samples in the docs and Bob Beauchamin's article were fine in terms of creating the connection, creating the command, opening the connection, creating the dependency, creating an event handler, etc worked fine.

Here are some things that I was unsure about.

All of the samples I saw showed doing a read on the SqlDataReader that was returned by the command that I attached the dependency to. So I started out with this code (which works):

            SqlDataReader rdr=cmd.ExecuteReader();
            while (rdr.Read())
                Console.WriteLine(rdr[0]);
            rdr.Close();

Once I had that working, I did what I really wanted to do which was return the SqlDataReader to my form (in real life, maybe a middle tier) which then loaded it into a DataTable and did something with the DataTable. So I changed the code to:

           SqlDataReader rdr=cmd.ExecuteReader();
           return rdr;

and that worked just fine. So according to this test it is NOT necessary to do a read on the SqlDataReader for the notification to fire.

The placement of the Open method of the connection did not seem to affect the notification query. Of course, just so long as it's before you try to execute the command. I tried it before creating the dependency and I tried it after the dependency and event handlers were already created. This makes perfect sense to me. But it was something I was worrying about when things weren't working. So that eases my mind to know that my instincts are okay.

So there were NOT a gazillion other things I had to do in SQL Server besides the frequently advertised ones.

1. Be sure the CLR is enabled in SQL Server
the tsql for that is

EXEC sp_configure 'show advanced options', '1'
go
RECONFIGURE
go
EXEC sp_configure 'clr enabled', 1
go
RECONFIGURE

2. Make sure that Enable_Broker is ON in your database
Wally explains how here

3. Make sure that SQLNotification will send messages with this TSQL statement
GRANT SEND send on service::SqlQueryNotificationService to guest
a) note that the word SqQueryNotificationService is case sensitive
b) you have to have admin priveleges in order to successfully run this command

4. The database user needs permission to subscribe to notification
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [the user]
 --that is, whatever user the calling application is that is making requests. I haven't tried ASP.NET yet, but I'm guessing that will be the Network Service account if IIS6 is your webserver.

5. Follow the query rules.
You have to write a query that can be parsed and that needs to follow some very specific rules. The three most notable are
a) The projected columns in the SELECT statement must be explicitly stated (i.e. select id, name, lastname from mytable not select * from mytable)
b)Table names must be qualified with two-part names (eg dbo.authors or person.contact)
c) Due to the above one, this means that all tables referenced in the statement must be in the same database.
I posted a full list here

Even though I fiddled for 2 days with this, I think the above represents the right combination of things to attend to.

The last caveat is that this is still a beta. From reading Bob's article, we can rest assured that MS is going to simplify this stuff. As for limiting your queries to “hello world“ applications (I'm exaggerating... but see Roman's comment) maybe they'll make it smarter or maybe the more full blown notification services will be the way to go. I don't really know - that's just a completely wild guess.

Posted from BLInk!

Monday, December 13, 2004 10:51:14 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

There are SO many caveats to using query notification wtih SQL Server. Things like the fact that it is not based on transactions (eg you will get a notifcation even if something is rolled back). You have to do a LOT of trolling around in the books online to find all of this stuff and frankly, I still do NOT have my notifications firing yet.

So here is a list from the Books Online for the October CTP of SQL Server 2005 of rules to follow when you are building a query with which you want to susbcribe to the service.

Query notifications are supported for SELECT statements that meet the following requirements:

  • The projected columns in the SELECT statement must be explicitly stated, and table names must be qualified with two-part names. Notice that this means that all tables referenced in the statement must be in the same database.
  • The statement may not use the asterisk (*) or table_name.* syntax to specify columns.
  • The statement may use unnamed columns or duplicate column names.
  • The statement must reference a base table.
  • The projected columns in the SELECT statement may not contain aggregate expressions unless the statement uses a GROUP BY expression. When a GROUP BY expression is provided, the select list may contain the aggregate functions COUNT_BIG() or SUM(). However, SUM() may not be specified for a nullable column. The statement may not specify HAVING, CUBE, or ROLLUP.
  • A projected column in the SELECT statement that is used as a simple expression must not appear more than once.
  • The statement must not include PIVOT or UNPIVOT operators.
  • The statement must not include the INTERSECT or EXCEPT operators.
  • The statement must not reference a view.
  • The statement must not contain any of the following: DISTINCT, COMPUTE or COMPUTE BY, or INTO.
  • The statement must not reference server global variables (@@variable_name).
  • The statement must not reference derived tables, temporary tables, or table variables.
  • The statement must not reference tables or views from other databases or servers.
  • The statement must not contain subqueries, outer joins, or self-joins.
  • The statement must not reference the large object types: text, ntext, and image.
  • The statement must not use the CONTAINS or FREETEXT full-text predicates.
  • The statement must not use rowset functions, including OPENROWSET and OPENQUERY.
  • The statement must not use any of the following aggregate functions: AVG, COUNT(*), MAX, MIN, STDEV, STDEVP, VAR, or VARP.
  • The statement must not use any nondeterministic functions, including ranking and windowing functions.
  • The statement must not contain user-defined aggregates.
  • The statement must not reference system tables or views, including catalog views and dynamic management views.
  • The statement must not include FOR BROWSE information.
  • The statement must not reference a queue.
  • The statement must not contain conditional statements that cannot change and cannot return results (for example, WHERE 1=0).

That's just the query rules. There are also rules for the connection and a lot of setup to do on the database. I will eventually succeed at this! I swear I will. Of course, by then, I will probably have been fired from all of the other contract work I am supposed to be doing. (Not really...)



Posted from BLInk!
Monday, December 13, 2004 9:51:21 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Monday, December 13, 2004 7:15:31 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Wow, according to FrankGo's blog, I am in some company! Charles, Dr. Neil, Billy Hollis, Markus Egger, Shawn van Ness, Sean Campbell! All of us and some other tablet whizes you may not know yet like Bernd Helzer from Agilix are speaking at Windows Anywhere in February!

 



Posted from BLInk!
Monday, December 13, 2004 6:10:57 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

UNCLE!

I have the right code from the documentation, from Bob B's awesome article, from the whidbey.adodtnet newsgroup, these posts from Wally McClure (rules, enabling CLR in SQL) and he was kind enough to spend a good chunk of time with me on i.m., too. But I cannot freaking get a notification from my SQL Server (Oct CTP bits). I have set up everything I know of in SQL, even tried this with my firewall temporarily turned off. Apparently besides the code, besides doing all of these things:

  •  grant send on service::SqlQueryNotificationService to guest  in msdb
  • GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [the user] in the database
  • ensuring that Enable_Broker is true in the database
  • getting your calls in your code in the correct order
  • making a proper query statement

there seem to be some 400+ other rules to follow. I have been changing the order of events in my code, reading through the online books, investingating the sql logs, learning more about SQL Server 2005 than I really care to/want to/have time for right now, and on it goes...

Okay it's a beta. But really. Eight hours. I freakin' give up. But of course, that's a lie. I will post this and then think of 24 other things to try and just keep at it until .....who knows...?



Posted from BLInk!
Monday, December 13, 2004 5:49:00 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |