The Education of a Programmer (Me)

Just another WordPress.com site

Month: June, 2014

Packt Publishing Sale

Disclaimer – From time to time, I do reviews for Packt Publishing and in return, I receive free copies of the books I review. I also write blog posts like these to promote their sales from time to time. I do this because I like the quality of their material and with more business, there are more opportunities for me to review books for them.

They are now celebrating their 10th anniversary and they are running another sale, hence the reason I’m writing this now. From the 26th of June until the 5th of July, Packt is offering all of their eBooks and videos for $10 a piece. While they are normally affordable, this is a very good sale. If you are going to go check it out, and you should, use this link so they know you came from my blog. Or click the graphic below!

 

10 days 10 years - Home Banner

Advertisements

Even more inches and Github Commits

Well, Bugs and I, from my previous post have made many more strides on my “wascally web app”. (Pardon the pun, but I’m full of them when I’m trying to make sense of this stuff.) Now, it’s deployed and useful. I’m at the stage, now, where it’s fun working on it and making the incremental improvements which ensure that my admins will not only use it, but will like how it comes out.

The nice part was solving each of these incremental mysteries and then improving it without saying, “I can’t do this, solve it for me,” on the various boards. I added in a search feature for subscriptions based on the user id so I can grab each users subscriptions. It was built in response to not being able to delete a user until the subscriptions were accounted for because of foreign key relationships. Later, read today, I changed the table structure of the underlying subscription table to enable cascade deletions so when you delete a user, the database also deletes the user’s subscriptions.

I’ve left the ID to be set by the admin because it works and because I can reuse IDs that way for deletions. Oracle’s default behaviour is to reserve 20 id’s at a time when you write an incremental ID trigger. So this seems to circumvent that. It’s a little more work from the admin, but it’s not too onerous.

I fixed the name entry into upper case through javascript. It works and it’s not problematic, so I’m happy about that.

I built my dropdown lists with a little bit of help and then added those into the page along with finding the IE problem. It turned out to be client side and with a little adjustment to the quirks mode, it’s all good. So this is, effectively, done and deployed. YaY!!

Getting Ever and Ever Closer

As I type the title, I hear Bugs Bunny, “Slowly he turns, step by step, inch by inch.” That is how this web application feels like. Step by Step, Inch by Inch I make some progress. I finally was able to break through the ODP.NET issues. I broke down and used the managed driver and then insured it was registered in the machine.config files for both x64 and x86 architectures. To me, this feels a bit like overkill. I had set the .dll to Copy Local=”true”, so IIS should not need to access the server’s copy. (Though I had already copied there just because I had learned that valuable lesson quite painfully recently.) Be that as it may, that is what it needed. After that came the ORA-12504 error. It couldn’t find the proper tnsnames.ora file. However, that is a relatively easy fix. I just changed the Data Source = from the alias to the full TNS name. Violá, the app likes the change and now it works.

Of course, I wouldn’t be discussing “step by step” if that were the end of things. Version 1 in classic ASP allowed you to filter a user list by the sponsoring agency. I didn’t include that this time. However, my users are quite content not to have it as long as they can have a search box which allows them to query the user base. It didn’t take me too long to find this page. I modified the basics to fit what I wanted and it works. I had to go back and make a modification and that was to ensure the search always hit the database in upper case. However, I’ve used ToUpper() many other times, so it was a quick fix.

The next step has arrived. How do I ensure that the data which is being entered is written into the database using only upper case for the subscriber names? I’ve worked through a couple of different solutions and they haven’t panned out. In fact, the whole thing has shown me that the ID field trigger on the database isn’t actually catching on that it needs to fire and the application doesn’t need to set the ID. So for now, I will set the ID in the /Users/Create page. It’ s not my preferred solution, but it’s on the list of enhancements.

Also on the agenda are to see why the site renders perfectly in Chrome and Firefox, but won’t render in any version of IE (I run 11 myself), but will render perfectly in IE when I use my IIS Express configuration locally to test the site functionality. I tried to alter the properties at the solution level, but garnered an error stating the .NET versions don’t match. Back to that drawing board. I need to build radio buttons and/or drop down lists for /Users/Create and 3 fields which need to be restricted as to their possible entries. So far, everything I have researched shows it’s really easy, but doesn’t work.

And, if I can do it, make sure that the first and last name entries go into the db in upper case, not lower or mixed case.

Simple? Maybe. But it’s taking time to research since this is the first ASP.MVC app I’ve built.