Thursday, May 20, 2010

TableAdapter Wizard Query Parsing Quibble

I was working on a little project in Visual Studio 2008 using an SQL database. I went to add a TableAdapter to add some databound features on my form. I was having trouble with my query, but I had written similar queries in other TableAdapters and wanted to leave the wizard to have a peek. Seeking to save myself some typing, I left my query incomplete and I OK'ed my way through the wizard and ignored the parsing errors. I copied some code from another query and re-opened the wizard. The query worked like a charm now. The wizard didn't complain about anything - that is, until I hit the Finish button. I got an error message saying "There was an error parsing the query" followed by the token, line number and offset.

"Hey, what gives? My query is fine!" I was ready to slap a kid, Masahiro Chono-style.

But I figured it out.

For some reason, when you OK through the wiz on an incomplete or bad query, it sticks in the wizard's memory. Now, when you go back to the wiz and type in any query, it will still attempt to parse the original incomplete or bad query stuck in memory.

I was able to reproduce the error by leaving out the column name of the last line of my query, a GROUP BY statement. The token pointed at the BY keyword when I OK'ed through the wiz. This is understandable since you need to give a column name when using the GROUP BY statement. I then reopened the wiz and removed the GROUP BY statement, making it a healthy query. Guess what? The token pointed at the BY keyword still, even though there was no longer a "BY" in my query!

I worked around this by simply copying the query I wanted, deleting the erroneous TableAdapter, creating a new one, and pasting the query in during the wizard.

Lesson learned: Never OK through the TableAdapter wizard with an incomplete query!

Wednesday, May 5, 2010

Building Academics: Student Initiative to Benefit Institute's IT Services

I'm working on a simple, client-based application to help Student Computing Services manage the inventory of over 960 software titles and the accompanying licenses that they deploy across their four campus locations. But getting here was a little tricky.

At first, I proposed a web-based application. I sought the accessibility of the Internet.

Through several iterations of revising and eliciting client feedback, I learned that the political and jurisdictional circumstances of the client's environment prevent the deployment of a web-based software inventory system. One of the project requirements is that the Student Computing Services Section must have full jurisdiction over the product. This will not be possible with a web-based system. Hosting the database through a free hosting third-party is a security violation. Creating a database server will not be possible without crossing into the jurisdiction of the Networking Section.

The project was forced to become a client-side application. Though very limited in accessibility relative to a web-based system, the client assures me that it will be very useful to the Section. The project will still meet the requirements of the directed field study. It will still be a work of adequate significance and an excellent opportunity for the student to learn and gain experience. It will still involve the planning and development of a database and an application to interact with it.

For now, somewhat disappointed but still determined, I'm continuing to revise the concept and toss the idea around the office to get some feedback. I need to take care not to speak too loudly, though. There's a certain way of doing things around here, see.

Coding begins next week. For the full calendar of events, see this weblink.